Button.axaml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <Styles xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  3. <Style Selector="Button.Standard">
  4. <Setter Property="HorizontalAlignment" Value="Stretch" />
  5. <Setter Property="VerticalAlignment" Value="Stretch" />
  6. <Setter Property="HorizontalContentAlignment" Value="Center" />
  7. <Setter Property="VerticalContentAlignment" Value="Center" />
  8. <Setter Property="Padding" Value="10" />
  9. <Setter Property="Margin" Value="{DynamicResource PrsControlSpacing}" />
  10. <Setter Property="BorderBrush" Value="{DynamicResource PrsButtonBorder}" />
  11. <Setter Property="BorderThickness">
  12. <Setter.Value>
  13. <DynamicResource ResourceKey="PrsBorderThickness" />
  14. </Setter.Value>
  15. </Setter>
  16. <Setter Property="Background" Value="{DynamicResource PrsButtonBackground}" />
  17. <Setter Property="Foreground" Value="{DynamicResource PrsButtonForeground}" />
  18. <Setter Property="CornerRadius" Value="{DynamicResource PrsCornerRadius}" />
  19. </Style>
  20. <!-- Disable Hover Effects on Buttons -->
  21. <Style Selector="Button.Standard:pointerover /template/ ContentPresenter#PART_ContentPresenter">
  22. <Setter Property="BorderBrush" Value="{Binding $parent[Button].BorderBrush}" />
  23. <Setter Property="BorderThickness" Value="{Binding $parent[Button].BorderThickness}" />
  24. <Setter Property="Background" Value="{Binding $parent[Button].Background}" />
  25. <Setter Property="Foreground" Value="{Binding $parent[Button].Foreground}" />
  26. </Style>
  27. <Style Selector="Button.NoHover:pointerover /template/ ContentPresenter#PART_ContentPresenter">
  28. <Setter Property="BorderBrush" Value="{Binding $parent[Button].BorderBrush}" />
  29. <Setter Property="BorderThickness" Value="{Binding $parent[Button].BorderThickness}" />
  30. <Setter Property="Background" Value="{Binding $parent[Button].Background}" />
  31. <Setter Property="Foreground" Value="{Binding $parent[Button].Foreground}" />
  32. </Style>
  33. <Style Selector="Button.Transparent">
  34. <Setter Property="HorizontalAlignment" Value="Stretch" />
  35. <Setter Property="VerticalAlignment" Value="Stretch" />
  36. <Setter Property="HorizontalContentAlignment" Value="Center" />
  37. <Setter Property="VerticalContentAlignment" Value="Center" />
  38. <Setter Property="Margin" Value="{DynamicResource PrsControlSpacing}" />
  39. <Setter Property="Padding" Value="{DynamicResource PrsControlSpacing}" />
  40. <Setter Property="BorderBrush" Value="Transparent" />
  41. <Setter Property="BorderThickness" Value="0" />
  42. <Setter Property="Background" Value="Transparent" />
  43. <Setter Property="Foreground" Value="Transparent" />
  44. </Style>
  45. </Styles>