If you are using Microsoft Prism, you can use the IInteractionRequest
interface to create a MessageBox
view, but in fact go through return the necessary response to the view model.
If you use not with Microsoft Prism, see how this part works, either simulate it, or use a framework that does something similar.
Basically, this code should be included in your view model for verification, but replace the line where you explicitly call MessageBox and use IInteractionRequest
instead.
Here is the documentation related to the script you want to implement: Chapter 6: Advanced MVVM Scripts . See the section listed in User Interaction Templates .
source share