|
@@ -4,12 +4,13 @@
|
|
|
x:CompileBindings="True"
|
|
|
Selector="NativeMenuBar">
|
|
|
<Style.Resources>
|
|
|
- <local:InverseBooleanValueConverter x:Key="AvaloniaThemesDefaultNativeMenuBarInverseBooleanValueConverter" Default="True"/>
|
|
|
+ <local:InverseBooleanValueConverter x:Key="AvaloniaThemesFluentNativeMenuBarInverseBooleanValueConverter" Default="True"/>
|
|
|
+ <local:IBitmapToImageConverter x:Key="AvaloniaThemesFluentNativeMenuBarIBitmapToImageConverter"/>
|
|
|
</Style.Resources>
|
|
|
<Setter Property="Template">
|
|
|
<ControlTemplate>
|
|
|
<Menu
|
|
|
- IsVisible="{Binding $parent[TopLevel].(NativeMenu.IsNativeMenuExported), Converter={StaticResource AvaloniaThemesDefaultNativeMenuBarInverseBooleanValueConverter}}"
|
|
|
+ IsVisible="{Binding $parent[TopLevel].(NativeMenu.IsNativeMenuExported), Converter={StaticResource AvaloniaThemesFluentNativeMenuBarInverseBooleanValueConverter}}"
|
|
|
Items="{Binding $parent[TopLevel].(NativeMenu.Menu).Items}">
|
|
|
<Menu.Styles>
|
|
|
<Style x:CompileBindings="False" Selector="MenuItem">
|
|
@@ -19,6 +20,8 @@
|
|
|
<Setter Property="Command" Value="{Binding Command}"/>
|
|
|
<Setter Property="CommandParameter" Value="{Binding CommandParameter}"/>
|
|
|
<Setter Property="(NativeMenuBar.EnableMenuItemClickForwarding)" Value="True"/>
|
|
|
+ <!--NativeMenuItem is IBitmap and MenuItem is Image-->
|
|
|
+ <Setter Property="Icon" Value="{Binding Icon , Converter={StaticResource AvaloniaThemesFluentNativeMenuBarIBitmapToImageConverter}}"/>
|
|
|
</Style>
|
|
|
</Menu.Styles>
|
|
|
</Menu>
|