ContentPageCommandBarPage.xaml 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.Pages.ContentPageCommandBarPage">
  4. <DockPanel>
  5. <ScrollViewer DockPanel.Dock="Right" Width="260">
  6. <StackPanel Margin="12" Spacing="8">
  7. <TextBlock Text="Configuration" FontWeight="SemiBold" FontSize="16"
  8. Foreground="{DynamicResource SystemControlHighlightAccentBrush}" />
  9. <TextBlock Text="Position" FontWeight="SemiBold" />
  10. <ComboBox x:Name="PositionCombo"
  11. SelectedIndex="0"
  12. HorizontalAlignment="Stretch"
  13. SelectionChanged="OnPositionChanged">
  14. <ComboBoxItem Content="Top" />
  15. <ComboBoxItem Content="Bottom" />
  16. </ComboBox>
  17. <Separator />
  18. <TextBlock Text="Manage Items" FontWeight="SemiBold" />
  19. <CheckBox x:Name="UseIconCheck" Content="Use Icon (primary items)" />
  20. <Button Content="Add Primary Item" HorizontalAlignment="Stretch" Click="OnAddPrimary" />
  21. <Button Content="Add Secondary Item" HorizontalAlignment="Stretch" Click="OnAddSecondary" />
  22. <Button Content="Add Separator" HorizontalAlignment="Stretch" Click="OnAddSeparator" />
  23. <Button Content="Clear All" HorizontalAlignment="Stretch" Click="OnClearAll" />
  24. <Separator />
  25. <TextBlock Text="Navigation" FontWeight="SemiBold" />
  26. <Button Content="Push Page" HorizontalAlignment="Stretch" Click="OnPush" />
  27. <Button Content="Pop Page" HorizontalAlignment="Stretch" Click="OnPop" />
  28. <Separator />
  29. <TextBlock Text="About" FontWeight="SemiBold" />
  30. <StackPanel Spacing="6">
  31. <Grid ColumnDefinitions="Auto,*">
  32. <TextBlock Text="•" FontSize="12" Opacity="0.7" Margin="0,0,6,0" />
  33. <TextBlock Grid.Column="1"
  34. Text="NavigationPage.SetTopCommandBar(page, bar): places a CommandBar inside the navigation bar area at the top."
  35. FontSize="12"
  36. Opacity="0.7"
  37. TextWrapping="Wrap" />
  38. </Grid>
  39. <Grid ColumnDefinitions="Auto,*">
  40. <TextBlock Text="•" FontSize="12" Opacity="0.7" Margin="0,0,6,0" />
  41. <TextBlock Grid.Column="1"
  42. Text="NavigationPage.SetBottomCommandBar(page, bar): places a CommandBar below the page content at the bottom."
  43. FontSize="12"
  44. Opacity="0.7"
  45. TextWrapping="Wrap" />
  46. </Grid>
  47. <Grid ColumnDefinitions="Auto,*">
  48. <TextBlock Text="•" FontSize="12" Opacity="0.7" Margin="0,0,6,0" />
  49. <TextBlock Grid.Column="1"
  50. Text="Each ContentPage has its own CommandBar. It is replaced when navigating between pages."
  51. FontSize="12"
  52. Opacity="0.7"
  53. TextWrapping="Wrap" />
  54. </Grid>
  55. </StackPanel>
  56. </StackPanel>
  57. </ScrollViewer>
  58. <Border DockPanel.Dock="Right" Width="1" Background="{DynamicResource SystemControlForegroundBaseMediumLowBrush}" />
  59. <Grid Margin="12" RowDefinitions="Auto,*">
  60. <TextBlock x:Name="StatusText"
  61. Text="No items added"
  62. FontSize="12"
  63. Opacity="0.7"
  64. Margin="0,0,0,8" />
  65. <Border Grid.Row="1"
  66. BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
  67. BorderThickness="1"
  68. CornerRadius="6"
  69. ClipToBounds="True">
  70. <NavigationPage x:Name="DemoNav" />
  71. </Border>
  72. </Grid>
  73. </DockPanel>
  74. </UserControl>