Skip to content

Commit

Permalink
Fix NativeMenuBar exception.
Browse files Browse the repository at this point in the history
The `x:DataType="NativeMenuItem"` directive is incorrect as the items can also be `NativeMenuItemSeparator`s which don't have the bound properties.

Turn off compiled bindings here for now.

Fixes #7780
  • Loading branch information
grokys committed Apr 9, 2022
1 parent 01cf7b8 commit af7ad60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Avalonia.Themes.Fluent/Controls/NativeMenuBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
IsVisible="{Binding $parent[TopLevel].(NativeMenu.IsNativeMenuExported), Converter={StaticResource AvaloniaThemesDefaultNativeMenuBarInverseBooleanValueConverter}}"
Items="{Binding $parent[TopLevel].(NativeMenu.Menu).Items}">
<Menu.Styles>
<Style x:DataType="NativeMenuItem" Selector="MenuItem">
<Style x:CompileBindings="False" Selector="MenuItem">
<Setter Property="Header" Value="{Binding Header}"/>
<Setter Property="InputGesture" Value="{Binding Gesture}"/>
<Setter Property="Items" Value="{Binding Menu.Items}"/>
Expand Down

0 comments on commit af7ad60

Please sign in to comment.