-
Hello, how can I pass the selectedItem or the ID of the binding in a ListBox via ContextMenu? XAML
Viewmodel
Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I switched to a diffrent idea to solve it
By the DelItemClicked method I could receive the ItemId (out of the sender parameter) to remove it from the list. |
Beta Was this translation helpful? Give feedback.
-
Command parameter needs to be of You can cast it in runtime though, inside of the command, if you always pass an integer there. |
Beta Was this translation helpful? Give feedback.
Command parameter needs to be of
object
type, not integer, see https://learn.microsoft.com/en-us/dotnet/api/system.windows.input.icommand.execute?view=net-8.0#system-windows-input-icommand-execute(system-object).You can cast it in runtime though, inside of the command, if you always pass an integer there.