Based on my understanding, using InteractionRequests to achieve the functionality you are describing seems to be a valid approach which also keeps a clear separation of concerns between the view and view model.
You can read more about the benefits of using InteractionRequests
in a MVVM scenario in the following article by Brian Noyes:
For example, your view model could expose through properties an InteractionRequest
and a Command, which would raise the InteractionRequest
when invoked. Then, the view could implement an InteractionRequestTrigger
that would bind to the InteractionRequest property of the view model, and you could also bind the
SelectedItem property of the DataGrid to a property in the view model so that it is aware of which item of the
DataGrid is selected. Also, you could use an InvokeCommandAction
in the view to listening the corresponding event and invoke the aforementioned
Command in the view model when that event is raised.
By doing this, the view model would be in charge of when the interaction should be requested and the information to be used for that interaction, while the view would be in charge of presenting the interaction to the user.
You can find more information about InteractionRequests in the aforementioned blog post and in the following chapter of the
I hope your find this useful,