PathIcon.axaml 1.8 KB

12345678910111213141516171819202122232425262728293031323334
  1. <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  2. <ControlTheme x:Key="SukiPathIconStyle" TargetType="PathIcon">
  3. <Setter Property="Foreground" Value="{DynamicResource SukiText}" />
  4. <Setter Property="Background" Value="Transparent" />
  5. <Setter Property="Height" Value="{DynamicResource IconElementThemeHeight}" />
  6. <Setter Property="Width" Value="{DynamicResource IconElementThemeWidth}" />
  7. <Setter Property="Template">
  8. <ControlTemplate>
  9. <Border Background="{TemplateBinding Background}">
  10. <Viewbox Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
  11. <Path Data="{TemplateBinding Data}"
  12. Fill="{TemplateBinding Foreground}"
  13. Stretch="Uniform">
  14. <Path.Transitions>
  15. <Transitions>
  16. <BrushTransition Property="Fill" Duration="{DynamicResource ShortAnimationDuration}" />
  17. </Transitions>
  18. </Path.Transitions>
  19. </Path>
  20. </Viewbox>
  21. </Border>
  22. </ControlTemplate>
  23. </Setter>
  24. <Style Selector="^.Primary">
  25. <Setter Property="Foreground" Value="{DynamicResource SukiPrimaryColor}" />
  26. </Style>
  27. <Style Selector="^.Accent">
  28. <Setter Property="Foreground" Value="{DynamicResource SukiAccentColor}" />
  29. </Style>
  30. </ControlTheme>
  31. <ControlTheme x:Key="{x:Type PathIcon}"
  32. BasedOn="{StaticResource SukiPathIconStyle}"
  33. TargetType="PathIcon" />
  34. </ResourceDictionary>