CommandBarFirstLookPage.xaml 6.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.Pages.CommandBarFirstLookPage">
  4. <UserControl.Resources>
  5. <StreamGeometry x:Key="AddIcon">M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z</StreamGeometry>
  6. <StreamGeometry x:Key="SaveIcon">M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z</StreamGeometry>
  7. <StreamGeometry x:Key="ShareIcon">M18,16.08C17.24,16.08 16.56,16.38 16.04,16.85L8.91,12.7C8.96,12.47 9,12.24 9,12C9,11.76 8.96,11.53 8.91,11.3L15.96,7.19C16.5,7.69 17.21,8 18,8A3,3 0 0,0 21,5A3,3 0 0,0 18,2A3,3 0 0,0 15,5C15,5.24 15.04,5.47 15.09,5.7L8.04,9.81C7.5,9.31 6.79,9 6,9A3,3 0 0,0 3,12A3,3 0 0,0 6,15C6.79,15 7.5,14.69 8.04,14.19L15.16,18.34C15.11,18.55 15.08,18.77 15.08,19C15.08,20.61 16.39,21.91 18,21.91C19.61,21.91 20.92,20.61 20.92,19C20.92,17.39 19.61,16.08 18,16.08Z</StreamGeometry>
  8. <StreamGeometry x:Key="BoldIcon">M15.6,10.79C17.04,10.07 18,8.64 18,7C18,4.79 16.21,3 14,3H7V21H14.73C16.78,21 18.5,19.37 18.5,17.32C18.5,15.82 17.72,14.53 16.5,13.77C16.2,13.59 15.9,13.44 15.6,13.32V10.79M10,6.5H13C13.83,6.5 14.5,7.17 14.5,8C14.5,8.83 13.83,9.5 13,9.5H10V6.5M13.5,17.5H10V14H13.5C14.33,14 15,14.67 15,15.5C15,16.33 14.33,17.5 13.5,17.5Z</StreamGeometry>
  9. <StreamGeometry x:Key="ItalicIcon">M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z</StreamGeometry>
  10. <StreamGeometry x:Key="ExportIcon">M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20M16,11V18.1L13.9,16L11.1,18.8L8.3,16L11.1,13.2L9,11.1L16,11Z</StreamGeometry>
  11. <StreamGeometry x:Key="PrintIcon">M18,3H6V7H18M19,12A1,1 0 0,1 18,11A1,1 0 0,1 19,10A1,1 0 0,1 20,11A1,1 0 0,1 19,12M16,19H8V14H16M19,8H5A3,3 0 0,0 2,11V17H6V21H18V17H22V11A3,3 0 0,0 19,8Z</StreamGeometry>
  12. <StreamGeometry x:Key="DeleteIcon">M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z</StreamGeometry>
  13. </UserControl.Resources>
  14. <DockPanel>
  15. <ScrollViewer DockPanel.Dock="Right" Width="260">
  16. <StackPanel Margin="12" Spacing="8">
  17. <TextBlock Text="Configuration" FontWeight="SemiBold" FontSize="16"
  18. Foreground="{DynamicResource SystemControlHighlightAccentBrush}" />
  19. <TextBlock Text="Primary Commands" FontWeight="SemiBold" />
  20. <TextBlock Text="Buttons displayed directly in the bar: New, Save, Bold, Italic, Share."
  21. FontSize="12" Opacity="0.7" TextWrapping="Wrap" />
  22. <Separator />
  23. <TextBlock Text="Secondary Commands" FontWeight="SemiBold" />
  24. <TextBlock Text="Buttons in the overflow menu (three-dot icon): Export, Print, Delete."
  25. FontSize="12" Opacity="0.7" TextWrapping="Wrap" />
  26. <Separator />
  27. <TextBlock Text="Content Area" FontWeight="SemiBold" />
  28. <TextBlock Text="Custom content (e.g. 'Document Editor' text) displayed on the left side of the bar."
  29. FontSize="12" Opacity="0.7" TextWrapping="Wrap" />
  30. <Separator />
  31. <TextBlock Text="Separators" FontWeight="SemiBold" />
  32. <TextBlock Text="CommandBarSeparator creates visual dividers between command groups."
  33. FontSize="12" Opacity="0.7" TextWrapping="Wrap" />
  34. </StackPanel>
  35. </ScrollViewer>
  36. <Border DockPanel.Dock="Right" Width="1" Background="{DynamicResource SystemControlForegroundBaseMediumLowBrush}" />
  37. <ScrollViewer>
  38. <StackPanel Spacing="12" Margin="12,12,12,0">
  39. <TextBlock Classes="h2">A toolbar supporting primary and secondary commands with an optional overflow menu.</TextBlock>
  40. <CommandBar>
  41. <CommandBar.Content>
  42. <TextBlock Text="Document Editor" VerticalAlignment="Center" Margin="8,0" />
  43. </CommandBar.Content>
  44. <CommandBar.PrimaryCommands>
  45. <CommandBarButton Label="New" Click="OnButtonClick">
  46. <CommandBarButton.Icon><PathIcon Data="{StaticResource AddIcon}" /></CommandBarButton.Icon>
  47. </CommandBarButton>
  48. <CommandBarButton Label="Save" Click="OnButtonClick">
  49. <CommandBarButton.Icon><PathIcon Data="{StaticResource SaveIcon}" /></CommandBarButton.Icon>
  50. </CommandBarButton>
  51. <CommandBarSeparator />
  52. <CommandBarToggleButton Label="Bold" IsCheckedChanged="OnToggleChanged">
  53. <CommandBarToggleButton.Icon><PathIcon Data="{StaticResource BoldIcon}" /></CommandBarToggleButton.Icon>
  54. </CommandBarToggleButton>
  55. <CommandBarToggleButton Label="Italic" IsCheckedChanged="OnToggleChanged">
  56. <CommandBarToggleButton.Icon><PathIcon Data="{StaticResource ItalicIcon}" /></CommandBarToggleButton.Icon>
  57. </CommandBarToggleButton>
  58. <CommandBarSeparator />
  59. <CommandBarButton Label="Share" Click="OnButtonClick">
  60. <CommandBarButton.Icon><PathIcon Data="{StaticResource ShareIcon}" /></CommandBarButton.Icon>
  61. </CommandBarButton>
  62. </CommandBar.PrimaryCommands>
  63. <CommandBar.SecondaryCommands>
  64. <CommandBarButton Label="Export" Click="OnButtonClick">
  65. <CommandBarButton.Icon><PathIcon Data="{StaticResource ExportIcon}" /></CommandBarButton.Icon>
  66. </CommandBarButton>
  67. <CommandBarButton Label="Print" Click="OnButtonClick">
  68. <CommandBarButton.Icon><PathIcon Data="{StaticResource PrintIcon}" /></CommandBarButton.Icon>
  69. </CommandBarButton>
  70. <CommandBarSeparator />
  71. <CommandBarButton Label="Delete" Click="OnButtonClick">
  72. <CommandBarButton.Icon><PathIcon Data="{StaticResource DeleteIcon}" /></CommandBarButton.Icon>
  73. </CommandBarButton>
  74. </CommandBar.SecondaryCommands>
  75. </CommandBar>
  76. <TextBlock x:Name="StatusText"
  77. Text="Ready"
  78. FontSize="13"
  79. Opacity="0.7" />
  80. </StackPanel>
  81. </ScrollViewer>
  82. </DockPanel>
  83. </UserControl>