SplitViewPage.xaml 5.7 KB

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