ButtonPage.xaml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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="h2">A button control</TextBlock>
  6. <StackPanel Orientation="Horizontal"
  7. Margin="0,16,0,0"
  8. HorizontalAlignment="Center"
  9. Spacing="16">
  10. <StackPanel Orientation="Vertical" Spacing="8" Width="200">
  11. <Button>Standard _XAML Button</Button>
  12. <Button Foreground="White">Foreground</Button>
  13. <Button Background="{DynamicResource SystemAccentColor}">Background</Button>
  14. <Button IsEnabled="False">Disabled</Button>
  15. <Button Content="Re-themed">
  16. <Button.Styles>
  17. <Style>
  18. <Style.Resources>
  19. <SolidColorBrush x:Key="ThemeBorderMidBrush">Red</SolidColorBrush>
  20. <SolidColorBrush x:Key="ThemeControlHighBrush">DarkRed</SolidColorBrush>
  21. <SolidColorBrush x:Key="ButtonBorderBrush">Red</SolidColorBrush>
  22. <SolidColorBrush x:Key="ButtonBackground">DarkRed</SolidColorBrush>
  23. <SolidColorBrush x:Key="ButtonBackgroundPointerOver">Red</SolidColorBrush>
  24. <SolidColorBrush x:Key="ButtonBackgroundPressed">OrangeRed</SolidColorBrush>
  25. </Style.Resources>
  26. </Style>
  27. </Button.Styles>
  28. </Button>
  29. <RepeatButton Name="RepeatButton">
  30. <TextBlock Name="RepeatButtonTextBlock" Text="Repeat Button: 0" />
  31. </RepeatButton>
  32. <ToggleButton Content="Toggle Button"/>
  33. </StackPanel>
  34. <StackPanel Orientation="Vertical" Spacing="8" Width="150">
  35. <Button BorderThickness="0">No Border</Button>
  36. <Button BorderBrush="{DynamicResource SystemAccentColor}">Border Color</Button>
  37. <Button BorderBrush="{DynamicResource SystemAccentColor}" BorderThickness="4">Thick Border</Button>
  38. <Button BorderBrush="{DynamicResource SystemAccentColor}" BorderThickness="4" IsEnabled="False">Disabled</Button>
  39. <Button BorderBrush="{DynamicResource SystemAccentColor}" KeyboardNavigation.IsTabStop="False">IsTabStop=False</Button>
  40. </StackPanel>
  41. </StackPanel>
  42. </StackPanel>
  43. </UserControl>