ExpanderPage.xaml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:viewModels="using:ControlCatalog.ViewModels"
  4. x:Class="ControlCatalog.Pages.ExpanderPage"
  5. x:DataType="viewModels:ExpanderPageViewModel">
  6. <StackPanel Orientation="Vertical" Spacing="4">
  7. <TextBlock Classes="h2">Expands to show nested content</TextBlock>
  8. <StackPanel Orientation="Vertical"
  9. Margin="0,16,0,0"
  10. HorizontalAlignment="Center"
  11. Spacing="16">
  12. <Expander Header="Expand Up" ExpandDirection="Up"
  13. CornerRadius="{Binding CornerRadius}">
  14. <StackPanel>
  15. <TextBlock>Expanded content</TextBlock>
  16. </StackPanel>
  17. </Expander>
  18. <Expander Header="Expand Down" ExpandDirection="Down"
  19. CornerRadius="{Binding CornerRadius}">
  20. <StackPanel>
  21. <TextBlock>Expanded content</TextBlock>
  22. </StackPanel>
  23. </Expander>
  24. <Expander Header="Expand Left" ExpandDirection="Left"
  25. CornerRadius="{Binding CornerRadius}">
  26. <StackPanel>
  27. <TextBlock>Expanded content</TextBlock>
  28. </StackPanel>
  29. </Expander>
  30. <Expander Header="Expand Right" ExpandDirection="Right"
  31. CornerRadius="{Binding CornerRadius}">
  32. <StackPanel>
  33. <TextBlock>Expanded content</TextBlock>
  34. </StackPanel>
  35. </Expander>
  36. <Expander ExpandDirection="Down"
  37. CornerRadius="{Binding CornerRadius}">
  38. <Expander.Header>
  39. <Button Content="Control in Header" />
  40. </Expander.Header>
  41. <StackPanel>
  42. <TextBlock>Expanded content</TextBlock>
  43. </StackPanel>
  44. </Expander>
  45. <Expander Header="Disabled"
  46. IsEnabled="False"
  47. ExpandDirection="Down"
  48. CornerRadius="{Binding CornerRadius}">
  49. <StackPanel>
  50. <TextBlock>Expanded content</TextBlock>
  51. </StackPanel>
  52. </Expander>
  53. <CheckBox IsChecked="{Binding Rounded}">Rounded</CheckBox>
  54. <Expander x:Name="CollapsingDisabledExpander"
  55. Header="Collapsing Disabled"
  56. IsExpanded="True"
  57. ExpandDirection="Down"
  58. CornerRadius="{Binding CornerRadius}">
  59. <StackPanel>
  60. <TextBlock>Expanded content</TextBlock>
  61. </StackPanel>
  62. </Expander>
  63. <Expander x:Name="ExpandingDisabledExpander"
  64. Header="Expanding Disabled"
  65. IsExpanded="False"
  66. ExpandDirection="Down"
  67. CornerRadius="{Binding CornerRadius}">
  68. <StackPanel>
  69. <TextBlock>Expanded content</TextBlock>
  70. </StackPanel>
  71. </Expander>
  72. </StackPanel>
  73. </StackPanel>
  74. </UserControl>