SplitViewPage.xaml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. xmlns:viewModels="using:ControlCatalog.ViewModels"
  6. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  7. x:Class="ControlCatalog.Pages.SplitViewPage"
  8. x:DataType="viewModels:SplitViewPageViewModel">
  9. <Border>
  10. <Grid ColumnDefinitions="*,225">
  11. <StackPanel Grid.Column="1" Orientation="Vertical" Spacing="4" Margin="5">
  12. <ToggleButton Name="PaneOpenButton"
  13. Content="IsPaneOpen"
  14. IsChecked="{Binding IsPaneOpen, ElementName=SplitView}" />
  15. <ToggleButton Name="UseLightDismissOverlayModeButton"
  16. Content="UseLightDismissOverlayMode"
  17. IsChecked="{Binding UseLightDismissOverlayMode, ElementName=SplitView}" />
  18. <ComboBox Name="Placement" Width="170" Margin="10" SelectedIndex="{Binding Placement}">
  19. <ComboBoxItem>Left</ComboBoxItem>
  20. <ComboBoxItem>Right</ComboBoxItem>
  21. <ComboBoxItem>Top</ComboBoxItem>
  22. <ComboBoxItem>Bottom</ComboBoxItem>
  23. </ComboBox>
  24. <TextBlock Text="DisplayMode" />
  25. <ComboBox Name="DisplayModeSelector" Width="170" Margin="10" SelectedIndex="{Binding DisplayMode}">
  26. <ComboBoxItem>Inline</ComboBoxItem>
  27. <ComboBoxItem>CompactInline</ComboBoxItem>
  28. <ComboBoxItem>Overlay</ComboBoxItem>
  29. <ComboBoxItem>CompactOverlay</ComboBoxItem>
  30. </ComboBox>
  31. <TextBlock Text="PaneBackground" />
  32. <ComboBox Name="PaneBackgroundSelector" SelectedIndex="0" Width="170" Margin="10">
  33. <ComboBoxItem Tag="{DynamicResource CatalogChromeMediumColor}">CatalogChromeMediumColor</ComboBoxItem>
  34. <ComboBoxItem Tag="Red">Red</ComboBoxItem>
  35. <ComboBoxItem Tag="Blue">Blue</ComboBoxItem>
  36. <ComboBoxItem Tag="Green">Green</ComboBoxItem>
  37. </ComboBox>
  38. <TextBlock Text="{Binding Value, ElementName=OpenPaneLengthSlider, StringFormat='{}OpenPaneLength: {0}'}" />
  39. <Slider Name="OpenPaneLengthSlider" Value="256" Minimum="128" Maximum="500"
  40. Width="150" />
  41. <TextBlock Text="{Binding Value, ElementName=CompactPaneLengthSlider, StringFormat='{}CompactPaneLength: {0}'}" />
  42. <Slider Name="CompactPaneLengthSlider" Value="48" Minimum="24" Maximum="128"
  43. Width="150" />
  44. </StackPanel>
  45. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  46. BorderThickness="1">
  47. <!--{Binding SelectedItem.Tag, ElementName=PaneBackgroundSelector}-->
  48. <SplitView Name="SplitView"
  49. PanePlacement="{Binding PanePlacement}"
  50. PaneBackground="{Binding ((Control)SelectedItem).Tag, ElementName=PaneBackgroundSelector, FallbackValue={x:Null}}"
  51. OpenPaneLength="{Binding Value, ElementName=OpenPaneLengthSlider}"
  52. CompactPaneLength="{Binding Value, ElementName=CompactPaneLengthSlider}"
  53. DisplayMode="{Binding CurrentDisplayMode}">
  54. <SplitView.Pane>
  55. <Grid>
  56. <Grid.RowDefinitions>
  57. <RowDefinition Height="Auto" />
  58. <RowDefinition Height="Auto" />
  59. <RowDefinition Height="*" />
  60. <RowDefinition Height="Auto" />
  61. </Grid.RowDefinitions>
  62. <TextBlock Text="PANE CONTENT" FontWeight="Bold" Name="PaneHeader" Margin="5,12,0,0" />
  63. <ComboBox Width="150" Grid.Row="1">
  64. <ComboBoxItem Content="Item1"/>
  65. <ComboBoxItem Content="Item2"/>
  66. <ComboBoxItem Content="Item3"/>
  67. </ComboBox>
  68. <ListBoxItem Grid.Row="2" VerticalAlignment="Top" Margin="0 10">
  69. <StackPanel Orientation="Horizontal">
  70. <!--Path glyph from materialdesignicons.com-->
  71. <Border Width="48">
  72. <Viewbox Width="24" Height="24" HorizontalAlignment="Left">
  73. <Canvas Width="24" Height="24">
  74. <Path Fill="{DynamicResource CatalogBaseHighColor}" 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" />
  75. </Canvas>
  76. </Viewbox>
  77. </Border>
  78. <TextBlock Text="People" VerticalAlignment="Center" />
  79. </StackPanel>
  80. </ListBoxItem>
  81. <TextBlock Grid.Row="3" Text="Item at bottom" Margin="60,12" />
  82. </Grid>
  83. </SplitView.Pane>
  84. <Grid>
  85. <TextBlock FontSize="14" FontWeight="700" Text="SplitViewContent" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource CatalogBaseHighColor}" />
  86. <TextBlock FontSize="14" FontWeight="700" Text="SplitViewContent" TextAlignment="Left" Foreground="{DynamicResource CatalogBaseHighColor}" />
  87. <TextBlock FontSize="14" FontWeight="700" Text="SplitViewContent" HorizontalAlignment="Right" TextAlignment="Left" Foreground="{DynamicResource CatalogBaseHighColor}" />
  88. <TextBlock FontSize="14" FontWeight="700" Text="SplitViewContent" VerticalAlignment="Bottom" TextAlignment="Left" Foreground="{DynamicResource CatalogBaseHighColor}" />
  89. <TextBlock FontSize="14" FontWeight="700" Text="SplitViewContent" VerticalAlignment="Bottom" HorizontalAlignment="Right" TextAlignment="Left" Foreground="{DynamicResource CatalogBaseHighColor}" />
  90. </Grid>
  91. </SplitView>
  92. </Border>
  93. </Grid>
  94. </Border>
  95. </UserControl>