How to create a modal dialog with MVVM highlighting
1 answer
You should use a DialogService, which abstracts the visual representation of the view so that you can "show" in the view model (and hopefully later on) mock it for testing.
Read more about DialogService here .
Dialogs can be registered with the service in several ways - this can happen for a type in static constructors (which you somehow need to enforce) or more explicitly through attributes in assemblies. It is even possible to use class attributes. It depends on your startup sequence and overall infrastructure.
0
source to share