using the System.Windows.Controls.ChildWindow I can create a modal dialog and show it without setting a containing control.
MyChildWindow window = new MyChildWindow();
window.Show();
This lends itselft to the MVVM pattern very well. Is it possible to do them same with the XamWebDialogWindow?
Hello Brian,
The answer is yes you can do that. You just need to add the XamDialogWindow to the Visual Tree.
Here a sample code:
var dlgWin = new XamWebDialogWindow(); this.LayoutRoot.Children.Add(dlgWin); dlgWin.Show();Hope this helps.
Don't do it this way. Your ViewModel should never know about the LayoutRoot. I just blogged about how to show the XamDialogWindow in a ViewModel without it being part of the visual tree. Of course, as the post says, I would still use a Dialog Service to show the dialog as your VM should be ignorant to Views.
http://brianlagunas.com/2013/05/18/showing-the-xamdialogwindow-from-a-viewmodel-in-silverlight-and-wpf/