Search code examples
c#.netmvvm-light

How to pass event arguments from view to view model?


I had a project which its version was .NET 4.0 and I changed it to 4.5.1. Then, I uninstall my MVVM Light 4.0 and install the new MVVM Light, that is 5.0.0.1.

However, now I don't have the EventToCommand and I would like to pass the arguments of an event to the view model. For example, when I select an item in a DataGrid, I want to know in the ViewModel which item is selected, and since this property is not a dependency property, I use MVVM Light to pass this.

So how can I pass the arguments from an event from the view to the view model?

Thanks.


Solution

  • From their site, it is mentioned that: This version doesn’t include EventToCommand, please use InvokeCommandAction instead.

    There is another solution provided here, which might help you.