ButtonPage.xaml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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="200">
  12. <Button>Standard XAML Button</Button>
  13. <Button Foreground="White">Foreground</Button>
  14. <Button Background="{DynamicResource SystemAccentColor}">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. <SolidColorBrush x:Key="ButtonBorderBrush">Red</SolidColorBrush>
  23. <SolidColorBrush x:Key="ButtonBackground">DarkRed</SolidColorBrush>
  24. <SolidColorBrush x:Key="ButtonBackgroundPointerOver">Red</SolidColorBrush>
  25. <SolidColorBrush x:Key="ButtonBackgroundPressed">OrangeRed</SolidColorBrush>
  26. </Style.Resources>
  27. </Style>
  28. </Button.Styles>
  29. </Button>
  30. <RepeatButton Name="RepeatButton">
  31. <TextBlock Name="RepeatButtonTextBlock" Text="Repeat Button: 0" />
  32. </RepeatButton>
  33. <ToggleButton Content="Toggle Button"/>
  34. </StackPanel>
  35. <StackPanel Orientation="Vertical" Spacing="8" Width="150">
  36. <Button BorderThickness="0">No Border</Button>
  37. <Button BorderBrush="{DynamicResource SystemAccentColor}">Border Color</Button>
  38. <Button BorderBrush="{DynamicResource SystemAccentColor}" BorderThickness="4">Thick Border</Button>
  39. <Button BorderBrush="{DynamicResource SystemAccentColor}" BorderThickness="4" IsEnabled="False">Disabled</Button>
  40. <Button BorderBrush="{DynamicResource SystemAccentColor}" KeyboardNavigation.IsTabStop="False">IsTabStop=False</Button>
  41. </StackPanel>
  42. </StackPanel>
  43. </StackPanel>
  44. </UserControl>