IsEnabled Binding on MenuItem not working if Command is bound
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
I have a MenuItem.IsEnabled bound to a observable property with a NullToBoolConverter.
With breakpoints in the converter I can confirm it is called on changes and returns true but the MenuItem stays disabled.
<ui:MenuItem
Header="Löschen"
Icon="{ui:SymbolIcon Symbol=Delete24}"
Command="{Binding ViewModel.RemoveHelperCommand}"
IsEnabled="{Binding ViewModel.SelectedHelper, Converter={StaticResource NullToBoolConverter}, ConverterParameter='NullIsFalse', Mode=OneWay}"/>
I was able to fix it by removing the Command={Bionding binding.
To Reproduce
See description.
Expected behavior
The binding just works like without a Command binding.
Screenshots
No response
OS version
Windows 11 24H2
.NET version
.NET Framework 4.8
WPF-UI NuGet version
4.0.2
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the XAML in the issue with WPF-UI 4.0.2 on Windows 11 and compare the behavior with and without the Command binding. The work is done when MenuItem.IsEnabled follows the observable value while the Command remains bound.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100