ButtonPage.xaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.Pages.ButtonPage">
  4. <StackPanel Orientation="Vertical" Spacing="4">
  5. <TextBlock Classes="h1">Button</TextBlock>
  6. <TextBlock Classes="h2">A button control</TextBlock>
  7. <StackPanel Orientation="Horizontal"
  8. Margin="0,16,0,0"
  9. HorizontalAlignment="Center"
  10. Spacing="16">
  11. <StackPanel Orientation="Vertical" Spacing="8" Width="150">
  12. <Button>Button</Button>
  13. <Button Foreground="White">Foreground</Button>
  14. <Button Background="{DynamicResource ThemeAccentBrush}">Background</Button>
  15. <Button IsEnabled="False">Disabled</Button>
  16. <Button Content="Re-themed">
  17. <Button.Styles>
  18. <Style>
  19. <Style.Resources>
  20. <SolidColorBrush x:Key="ThemeBorderMidBrush">Red</SolidColorBrush>
  21. <SolidColorBrush x:Key="ThemeControlHighBrush">DarkRed</SolidColorBrush>
  22. </Style.Resources>
  23. </Style>
  24. </Button.Styles>
  25. </Button>
  26. </StackPanel>
  27. <StackPanel Orientation="Vertical" Spacing="8" Width="150">
  28. <Button BorderThickness="0">No Border</Button>
  29. <Button BorderBrush="{DynamicResource ThemeAccentBrush}">Border Color</Button>
  30. <Button BorderBrush="{DynamicResource ThemeAccentBrush}" BorderThickness="4">Thick Border</Button>
  31. <Button BorderBrush="{DynamicResource ThemeAccentBrush}" BorderThickness="4" IsEnabled="False">Disabled</Button>
  32. </StackPanel>
  33. </StackPanel>
  34. </StackPanel>
  35. </UserControl>