1
0

App.xaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. Name="Avalonia ControlCatalog"
  6. x:Class="ControlCatalog.App">
  7. <Application.Resources>
  8. <ResourceDictionary>
  9. <!-- Custom controls defined in other assemblies -->
  10. <ResourceDictionary.MergedDictionaries>
  11. <ResourceInclude Source="avares://ControlSamples/HamburgerMenu/HamburgerMenu.xaml" />
  12. </ResourceDictionary.MergedDictionaries>
  13. <!-- Resources used only in the control catalog -->
  14. <ResourceDictionary.ThemeDictionaries>
  15. <ResourceDictionary x:Key="Default">
  16. <Color x:Key="CatalogBaseLowColor">#33000000</Color>
  17. <Color x:Key="CatalogBaseMediumColor">#99000000</Color>
  18. <Color x:Key="CatalogChromeMediumColor">#FFE6E6E6</Color>
  19. <Color x:Key="CatalogBaseHighColor">#FF000000</Color>
  20. </ResourceDictionary>
  21. <ResourceDictionary x:Key="Dark">
  22. <Color x:Key="CatalogBaseLowColor">#33FFFFFF</Color>
  23. <Color x:Key="CatalogBaseMediumColor">#99FFFFFF</Color>
  24. <Color x:Key="CatalogChromeMediumColor">#FF1F1F1F</Color>
  25. <Color x:Key="CatalogBaseHighColor">#FFFFFFFF</Color>
  26. </ResourceDictionary>
  27. </ResourceDictionary.ThemeDictionaries>
  28. <!-- Styles attached dynamically depending on current theme (simple or fluent) -->
  29. <FluentTheme x:Key="FluentTheme" />
  30. <SimpleTheme x:Key="SimpleTheme" />
  31. <StyleInclude x:Key="ColorPickerFluent" Source="avares://Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml" />
  32. <StyleInclude x:Key="ColorPickerSimple" Source="avares://Avalonia.Controls.ColorPicker/Themes/Simple/Simple.xaml" />
  33. </ResourceDictionary>
  34. </Application.Resources>
  35. <Application.Styles>
  36. <Style Selector="TextBlock.h1, TextBlock.h2, TextBlock.h3">
  37. <Setter Property="TextWrapping" Value="Wrap" />
  38. </Style>
  39. <Style Selector="TextBlock.h1">
  40. <Setter Property="FontSize" Value="16" />
  41. <Setter Property="FontWeight" Value="Medium" />
  42. </Style>
  43. <Style Selector="TextBlock.h2">
  44. <Setter Property="FontSize" Value="14" />
  45. </Style>
  46. <Style Selector="TextBlock.h3">
  47. <Setter Property="FontSize" Value="12" />
  48. </Style>
  49. <Style Selector="Label.h1">
  50. <Setter Property="FontSize" Value="16" />
  51. <Setter Property="FontWeight" Value="Medium" />
  52. </Style>
  53. <Style Selector="Label.h2">
  54. <Setter Property="FontSize" Value="14" />
  55. </Style>
  56. <Style Selector="Label.h3">
  57. <Setter Property="FontSize" Value="12" />
  58. </Style>
  59. </Application.Styles>
  60. <TrayIcon.Icons>
  61. <TrayIcons>
  62. <TrayIcon Icon="/Assets/test_icon.ico" MacOSProperties.IsTemplateIcon="true" ToolTipText="Avalonia Tray Icon ToolTip">
  63. <TrayIcon.Menu>
  64. <NativeMenu>
  65. <NativeMenuItem Header="Settings">
  66. <NativeMenu>
  67. <NativeMenuItem Header="Option 1" ToggleType="Radio" IsChecked="True" />
  68. <NativeMenuItem Header="Option 2" ToggleType="Radio" />
  69. <NativeMenuItemSeparator />
  70. <NativeMenuItem Header="Option 3" ToggleType="CheckBox" IsChecked="True" />
  71. <NativeMenuItem Icon="/Assets/test_icon.ico" Header="Restore Defaults" Command="{Binding RestoreDefault}" />
  72. <NativeMenuItem Header="Disabled option" IsEnabled="False" />
  73. <NativeMenuItem Header="Hidden option" IsVisible="False" />
  74. </NativeMenu>
  75. </NativeMenuItem>
  76. <NativeMenuItem Header="Exit" Command="{Binding ExitCommand}" />
  77. </NativeMenu>
  78. </TrayIcon.Menu>
  79. </TrayIcon>
  80. </TrayIcons>
  81. </TrayIcon.Icons>
  82. </Application>