I’m writing WPF application, that’s using MVVMLight. I have a DataGrid and I wanna connect event of selecting row to command. That’s the easy part. The hard(for me of course ;]) part is to get the entity that’s connected with the selected row. How can I do that?
I’m writing WPF application, that’s using MVVMLight. I have a DataGrid and I wanna
Share
You have many ways of doing so.
The first one would be to pass the selected row as a command parameter. You can do this by XAML or code-behind.
You can also create a selected item property in your view model and bind it to your control.