App.xaml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <Application xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:vm="using:ControlCatalog.ViewModels"
  4. x:DataType="vm:ApplicationViewModel"
  5. x:CompileBindings="True"
  6. Name="Avalonia ControlCatalog"
  7. x:Class="ControlCatalog.App">
  8. <Application.Resources>
  9. <ResourceDictionary>
  10. <ResourceDictionary.MergedDictionaries>
  11. <ResourceInclude Source="avares://ControlSamples/HamburgerMenu/HamburgerMenu.xaml" />
  12. </ResourceDictionary.MergedDictionaries>
  13. </ResourceDictionary>
  14. </Application.Resources>
  15. <Application.Styles>
  16. <Style Selector="TextBlock.h1, TextBlock.h2, TextBlock.h3">
  17. <Setter Property="TextWrapping" Value="Wrap" />
  18. </Style>
  19. <Style Selector="TextBlock.h1">
  20. <Setter Property="FontSize" Value="16" />
  21. <Setter Property="FontWeight" Value="Medium" />
  22. </Style>
  23. <Style Selector="TextBlock.h2">
  24. <Setter Property="FontSize" Value="14" />
  25. </Style>
  26. <Style Selector="TextBlock.h3">
  27. <Setter Property="FontSize" Value="12" />
  28. </Style>
  29. <Style Selector="Label.h1">
  30. <Setter Property="FontSize" Value="16" />
  31. <Setter Property="FontWeight" Value="Medium" />
  32. </Style>
  33. <Style Selector="Label.h2">
  34. <Setter Property="FontSize" Value="14" />
  35. </Style>
  36. <Style Selector="Label.h3">
  37. <Setter Property="FontSize" Value="12" />
  38. </Style>
  39. </Application.Styles>
  40. <TrayIcon.Icons>
  41. <TrayIcons>
  42. <TrayIcon Icon="/Assets/test_icon.ico" ToolTipText="Avalonia Tray Icon ToolTip">
  43. <TrayIcon.Menu>
  44. <NativeMenu>
  45. <NativeMenuItem Header="Settings">
  46. <NativeMenu>
  47. <NativeMenuItem Header="Option 1" ToggleType="Radio" IsChecked="True" Command="{Binding ToggleCommand}" />
  48. <NativeMenuItem Header="Option 2" ToggleType="Radio" IsChecked="True" Command="{Binding ToggleCommand}" />
  49. <NativeMenuItemSeparator />
  50. <NativeMenuItem Header="Option 3" ToggleType="CheckBox" IsChecked="True" Command="{Binding ToggleCommand}" />
  51. <NativeMenuItem Icon="/Assets/test_icon.ico" Header="Restore Defaults" Command="{Binding ToggleCommand}" />
  52. <NativeMenuItem Header="Disabled option" IsEnabled="False" />
  53. </NativeMenu>
  54. </NativeMenuItem>
  55. <NativeMenuItem Header="Exit" Command="{Binding ExitCommand}" />
  56. </NativeMenu>
  57. </TrayIcon.Menu>
  58. </TrayIcon>
  59. </TrayIcons>
  60. </TrayIcon.Icons>
  61. </Application>