MenuItem commands. #16036
-
Hey. I'm trying to put some commands on the menu-items of a Context Menu. Here for example
It throws an error saying that it cannot resolve the property or method of name RemoveTaskListCommand. The DataContext is set properly. If I just make an empty button, assigning that command works perfectly fine. I've also tried it using the PointerPressed events and Avalonia Behaviours, but that doesn't work as well. Help? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I cannot provide any suggestion without your data context definition. |
Beta Was this translation helpful? Give feedback.
-
It worked by just adding x:DataType to MenuItem. All bindings were appearing design-time , so I thought I wouldn't need it. |
Beta Was this translation helpful? Give feedback.
It worked by just adding x:DataType to MenuItem. All bindings were appearing design-time , so I thought I wouldn't need it.