NativeMenuBar broken on Windows with canExecute #10794
Open
Description
Describe the bug
Due to an error in NativeMenuBar
, all elements are taken over correctly, but the canExecute
observables are not checked further in RactiveCommand
s.
To Reproduce
Steps to reproduce the behavior:
Create a <NativeMenu>
with the following example entry: <NativeMenuItem Header="TestItem" Command="{Binding TestCommand}" />
and a <NativeMenuBar/>
to show the menu bar on Windows.
The code-behind contains the following:
public ICommand TestCommand { get; }
public MainWindowViewModel() {
TestCommand = ReactiveCommand.Create(() => { /* something*/ }, SomeOtherReactiveObject.WhenAnyValue
.WhenValueChanged(x => x.SomeProperty)
.Select(s => s == "someValue"));
}
Expected behavior
Actually, "TestItem" should be enabled if the condition is correct. However, the condition is only checked once.
Desktop (please complete the following information):
- OS: Windows
- Version 11
Additional context
I suspect it is because OnPropertyChanged()
is not handled in NativeMenuBar.cs as it is in NativeMenuItem.cs.