ContextMenu has an issue that results in the menu being initially disabled. Regardless of whether what they are bound to is set to enabled or disabled. This will be true until a valid left click is done, usually on a button or the content it self. The root cause is that the ContextMenu is on a separate visual and logical tree than the window. This results in the items being disabled initially until a click is made first (not right click, but left click).
Adding the following in the XAML to the menu item will resolve this issue:
Adding the following in the XAML to the menu item will resolve this issue:
1 | <MenuItem Head... CommandTarget="{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}" /> |
Comments
Post a Comment