You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a MenuItem Command is binded while in a ContextMenu.ItemTemplate, it seems to be disabled (gray out) and clicking does not work.
Note that all other values bind correctly from the same model, just not the command, and that the command binding is also compiled correctly.
The issue only occurs when ItemsSource with ItemTemplate is used, but if using static MenuItems it does work, example:
Ok, I found the solution using... Styles.
this is confusing and hard to discover, lead me to a lot of frustration and thus many users are reporting these kind of things.
I would say that using styles is a workaround but not a solution, the control should have a way to pass the ItemSource and MenuItems in a sane way a developer can use without going crazy...
Something like this should be possible:
Describe the bug
When a MenuItem Command is binded while in a ContextMenu.ItemTemplate, it seems to be disabled (gray out) and clicking does not work.
Note that all other values bind correctly from the same model, just not the command, and that the command binding is also compiled correctly.
The issue only occurs when ItemsSource with ItemTemplate is used, but if using static MenuItems it does work, example:
But of course, static items cannot replace dynamic templates, so it is not a workaround.
To Reproduce
Checkout this simple example in this repo (in the branch
issue-example-contextmenu-greyedout
):https://github.com/LazaroOnline/AvaloniaDataGridRowFlyoutRefresh-BugSample/tree/issue-example-contextmenu-greyedout
Run the app and try to right click on the DataGrid row to see the MenuItems that should not be disabled, but they are.
Here is a preview of the axaml from the repo:
Expected behavior
No response
Avalonia version
11.2.3
OS
Windows
Additional context
No response
The text was updated successfully, but these errors were encountered: