Hi Team,
I was following the sample MVVM WPF application from msdn. Everything seems tobe fine and closely a good sample to follow, but I was looking for opening a child window as Dialog from Menu -->open and thought a text input assing the input control to my child window tab and to the text control in usercontrol customer add, but couldn't find a solution. http://msdn.microsoft.com/en-us/magazine/dd419663.aspx link for the source any help on this would be of gr8 help.
Asked
Active
Viewed 5,679 times
1

Harry
- 338
- 1
- 6
- 19
2 Answers
2
Window1 win1 = new Window1();
win1.ShowDialog();
Window1 is the child window.This is a way to make child window to act as Dialog. If you want something like to fire Command from Parent window UI to its ViewModel then this ViewModel send message to its .xaml.cs file and then open Child window as dialog then go through MVVM Light API's. They provide way for communication from ViewModel to View.Go through this only if you want to follow strict MVVM pattern otherwise you can directly fire event from UI. I hope this will give you an idea.

yo chauhan
- 12,079
- 4
- 39
- 58
-
Thanks for your response, is it not possible without MVVM light i.e. with in the msdn link I have shared which does not use MVVM light. – Harry Nov 06 '12 at 06:08
0
here is an easy way to have dialog with mvvm.
all you have to call in your viewmodel is:
var result = this.uiDialogService.ShowDialog("Dialogwindow title goes here", dialogwindowVM);
-
Appriciate your answer, well my requirement is opening a child window as dialog from menu ussing MVVM. – Harry Nov 06 '12 at 06:06