SplitViewPage.xaml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  6. x:Class="ControlCatalog.Pages.SplitViewPage">
  7. <Border>
  8. <Grid ColumnDefinitions="*,225">
  9. <StackPanel Grid.Column="1" Orientation="Vertical" Spacing="4" Margin="5">
  10. <ToggleButton Name="PaneOpenButton"
  11. Content="IsPaneOpen"
  12. IsChecked="{Binding IsPaneOpen, ElementName=SplitView}" />
  13. <ToggleButton Name="UseLightDismissOverlayModeButton"
  14. Content="UseLightDismissOverlayMode"
  15. IsChecked="{Binding UseLightDismissOverlayMode, ElementName=SplitView}" />
  16. <ToggleSwitch OffContent="Left" OnContent="Right" Content="Placement" IsChecked="{Binding !IsLeft}" />
  17. <TextBlock Text="DisplayMode" />
  18. <ComboBox Name="DisplayModeSelector" Width="170" Margin="10" SelectedIndex="{Binding DisplayMode}">
  19. <ComboBoxItem>Inline</ComboBoxItem>
  20. <ComboBoxItem>CompactInline</ComboBoxItem>
  21. <ComboBoxItem>Overlay</ComboBoxItem>
  22. <ComboBoxItem>CompactOverlay</ComboBoxItem>
  23. </ComboBox>
  24. <TextBlock Text="PaneBackground" />
  25. <ComboBox Name="PaneBackgroundSelector" SelectedIndex="0" Width="170" Margin="10">
  26. <ComboBoxItem Tag="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}">SystemControlBackgroundChromeMediumLowBrush</ComboBoxItem>
  27. <ComboBoxItem Tag="Red">Red</ComboBoxItem>
  28. <ComboBoxItem Tag="Blue">Blue</ComboBoxItem>
  29. <ComboBoxItem Tag="Green">Green</ComboBoxItem>
  30. </ComboBox>
  31. <TextBlock Text="{Binding Value, ElementName=OpenPaneLengthSlider, StringFormat='{}OpenPaneLength: {0}'}" />
  32. <Slider Name="OpenPaneLengthSlider" Value="256" Minimum="128" Maximum="500"
  33. Width="150" />
  34. <TextBlock Text="{Binding Value, ElementName=CompactPaneLengthSlider, StringFormat='{}CompactPaneLength: {0}'}" />
  35. <Slider Name="CompactPaneLengthSlider" Value="48" Minimum="24" Maximum="128"
  36. Width="150" />
  37. </StackPanel>
  38. <Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}"
  39. BorderThickness="1">
  40. <!--{Binding SelectedItem.Tag, ElementName=PaneBackgroundSelector}-->
  41. <SplitView Name="SplitView"
  42. PanePlacement="{Binding PanePlacement}"
  43. PaneBackground="{Binding SelectedItem.Tag, ElementName=PaneBackgroundSelector}"
  44. OpenPaneLength="{Binding Value, ElementName=OpenPaneLengthSlider}"
  45. CompactPaneLength="{Binding Value, ElementName=CompactPaneLengthSlider}"
  46. DisplayMode="{Binding CurrentDisplayMode}">
  47. <SplitView.Pane>
  48. <Grid>
  49. <Grid.RowDefinitions>
  50. <RowDefinition Height="Auto" />
  51. <RowDefinition Height="Auto" />
  52. <RowDefinition Height="*" />
  53. <RowDefinition Height="Auto" />
  54. </Grid.RowDefinitions>
  55. <TextBlock Text="PANE CONTENT" FontWeight="Bold" Name="PaneHeader" Margin="5,12,0,0" />
  56. <ComboBox Width="150" Grid.Row="1">
  57. <ComboBoxItem Content="Item1"/>
  58. <ComboBoxItem Content="Item2"/>
  59. <ComboBoxItem Content="Item3"/>
  60. </ComboBox>
  61. <ListBoxItem Grid.Row="2" VerticalAlignment="Top" Margin="0 10">
  62. <StackPanel Orientation="Horizontal">
  63. <!--Path glyph from materialdesignicons.com-->
  64. <Border Width="48">
  65. <Viewbox Width="24" Height="24" HorizontalAlignment="Left">
  66. <Canvas Width="24" Height="24">
  67. <Path Fill="{DynamicResource SystemControlForegroundBaseHighBrush}" Data="M16 17V19H2V17S2 13 9 13 16 17 16 17M12.5 7.5A3.5 3.5 0 1 0 9 11A3.5 3.5 0 0 0 12.5 7.5M15.94 13A5.32 5.32 0 0 1 18 17V19H22V17S22 13.37 15.94 13M15 4A3.39 3.39 0 0 0 13.07 4.59A5 5 0 0 1 13.07 10.41A3.39 3.39 0 0 0 15 11A3.5 3.5 0 0 0 15 4Z" />
  68. </Canvas>
  69. </Viewbox>
  70. </Border>
  71. <TextBlock Text="People" VerticalAlignment="Center" />
  72. </StackPanel>
  73. </ListBoxItem>
  74. <TextBlock Grid.Row="3" Text="Item at bottom" Margin="60,12" />
  75. </Grid>
  76. </SplitView.Pane>
  77. <Grid>
  78. <TextBlock FontSize="14" FontWeight="700" Text="SplitViewContent" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" />
  79. <TextBlock FontSize="14" FontWeight="700" Text="SplitViewContent" TextAlignment="Left" Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" />
  80. <TextBlock FontSize="14" FontWeight="700" Text="SplitViewContent" HorizontalAlignment="Right" TextAlignment="Left" Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" />
  81. <TextBlock FontSize="14" FontWeight="700" Text="SplitViewContent" VerticalAlignment="Bottom" TextAlignment="Left" Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" />
  82. <TextBlock FontSize="14" FontWeight="700" Text="SplitViewContent" VerticalAlignment="Bottom" HorizontalAlignment="Right" TextAlignment="Left" Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" />
  83. </Grid>
  84. </SplitView>
  85. </Border>
  86. </Grid>
  87. </Border>
  88. </UserControl>