Browse Source

Fix NativeMenuBar exception.

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
pull/7954/head
Steven Kirk 5 years ago
parent
commit
af7ad60716
  1. 2
      src/Avalonia.Themes.Fluent/Controls/NativeMenuBar.xaml

2
src/Avalonia.Themes.Fluent/Controls/NativeMenuBar.xaml

@ -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}"/>

Loading…
Cancel
Save