Separator.axaml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <ResourceDictionary xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  3. <ControlTheme x:Key="SukiSeparatorStyle" TargetType="Separator">
  4. <Setter Property="Background" Value="Transparent" />
  5. <Setter Property="BorderBrush" Value="Transparent" />
  6. <Setter Property="BorderThickness" Value="0" />
  7. <Setter Property="CornerRadius" Value="0" />
  8. <Setter Property="Foreground" Value="{DynamicResource SukiLightBorderBrush}" />
  9. <Setter Property="MinHeight" Value="1" />
  10. <Setter Property="Height" Value="1" />
  11. <Setter Property="Margin" Value="0" />
  12. <Setter Property="Template">
  13. <ControlTemplate>
  14. <Border Name="PART_RootBorder"
  15. Background="{TemplateBinding Background}"
  16. BorderBrush="{TemplateBinding BorderThickness}"
  17. BorderThickness="{TemplateBinding BorderThickness}"
  18. CornerRadius="{TemplateBinding CornerRadius}">
  19. <Rectangle Name="PART_Content" Fill="{TemplateBinding Foreground}" />
  20. </Border>
  21. </ControlTemplate>
  22. </Setter>
  23. <Style Selector="^ /template/ Border#PART_RootBorder">
  24. <Setter Property="ClipToBounds" Value="True" />
  25. </Style>
  26. <Style Selector="^ /template/ Rectangle#PART_Content">
  27. <Setter Property="Height" Value="1" />
  28. <Setter Property="HorizontalAlignment" Value="Stretch" />
  29. <Setter Property="VerticalAlignment" Value="Center" />
  30. </Style>
  31. </ControlTheme>
  32. <ControlTheme x:Key="{x:Type Separator}" TargetType="Separator"
  33. BasedOn="{StaticResource SukiSeparatorStyle}" />
  34. </ResourceDictionary>