I am in the new MVVM. My current problem is the modular dialog box, which should start with "autorun" at the beginning.
I followed the WAF mail client example for modular dialogs. Is it right that you need to set the owner property of the dialog box to an instance of the main application window (and, of course, show the window with ShowDialog () instead of Show ()?
If you close this dialog box without configuration, the application will shut down. But now, if I open the main window in the designer mode of visual studios, the configuration dialog will appear, and if I close it, the visual studio will crash. This is because I call ShowDialog () on the configuration dialog in the constructor of my main window view model.
To avoid this, I can check the DesignerProperties.IsInDesignTool property, but this is more of a workaround as a good code style, right?
Do you have any suggestions? Thanks.
source share