RadioButtonPage.xaml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.Pages.RadioButtonPage">
  4. <StackPanel Orientation="Vertical" Spacing="4">
  5. <TextBlock Classes="h1">RadioButton</TextBlock>
  6. <TextBlock Classes="h2">Allows the selection of a single option of many</TextBlock>
  7. <StackPanel Orientation="Horizontal"
  8. Margin="0,16,0,0"
  9. HorizontalAlignment="Center"
  10. Spacing="16">
  11. <StackPanel Orientation="Vertical"
  12. Spacing="16">
  13. <RadioButton IsChecked="True">Option 1</RadioButton>
  14. <RadioButton>Option 2</RadioButton>
  15. <RadioButton IsChecked="{x:Null}">Option 3</RadioButton>
  16. <RadioButton IsEnabled="False">Disabled</RadioButton>
  17. </StackPanel>
  18. <StackPanel Orientation="Vertical"
  19. Spacing="16">
  20. <RadioButton IsChecked="True" IsThreeState="True">Three States: Option 1</RadioButton>
  21. <RadioButton IsChecked="False" IsThreeState="True">Three States: Option 2</RadioButton>
  22. <RadioButton IsChecked="{x:Null}" IsThreeState="True">Three States: Option 3</RadioButton>
  23. <RadioButton IsChecked="{x:Null}" IsThreeState="True" IsEnabled="False">Disabled</RadioButton>
  24. </StackPanel>
  25. <StackPanel Orientation="Vertical"
  26. Spacing="16">
  27. <RadioButton GroupName="A" IsChecked="True">Group A: Option 1</RadioButton>
  28. <RadioButton GroupName="A" IsEnabled="False">Group A: Disabled</RadioButton>
  29. <RadioButton GroupName="B">Group B: Option 1</RadioButton>
  30. <RadioButton GroupName="B" IsChecked="{x:Null}">Group B: Option 3</RadioButton>
  31. </StackPanel>
  32. <StackPanel Orientation="Vertical"
  33. Spacing="16">
  34. <RadioButton GroupName="A" IsChecked="True">Group A: Option 2</RadioButton>
  35. <RadioButton GroupName="B">Group B: Option 2</RadioButton>
  36. <RadioButton GroupName="B" IsChecked="{x:Null}">Group B: Option 4</RadioButton>
  37. </StackPanel>
  38. </StackPanel>
  39. </StackPanel>
  40. </UserControl>