Click here to Skip to main content
15,888,069 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have been searching for days for an easy method to open a MessageBox (ideally, any custom window) while still adhering to the MVVM architecture. From a method within the ViewModel, I need to prompt the user for some information before continuing.

All the examples I have found online appear (to me) to be extremely elaborate/intensive to get setup (such as this example Implementing Dialog Boxes in MVVM[^]) . I think part of the problem is most of the examples are using various frameworks and dependency injection that I am not using and don't fully understand, yet.

Is it possible to do this very simply - not using PRISM or MVVMLight? Or do they all require lots and lots of classes that you have to get setup before doing anything. I am really just looking for something barebones so I can get started and grow my usage and understanding from there. So far this is the only thing that has come close to appearing simple and that I kind of understand. Dialogs the MVVM Way[^]

What I have tried:

I have downloaded this example Dialogs the MVVM Way[^]. But am unsure if behaviors are the best and easiest way of doing this?
Posted
Comments
[no name] 5-Oct-18 0:44am    
MessageBox.Show(...);
MrGlass3 5-Oct-18 10:32am    
From the ViewModel? That would violate the MVVM architecture and require the ViewModel to know about the View.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900