I am working on a MVVM wpf application and I need to show various dialogs with ok cancel. I have seen few on the net but the look overcomplicated or may be its me struggling.
I Have noticed that many that use “IDialogService”
Can anybody point me to a link or has a snippet handy on how to implement a Dialog using a MVVM Pattern?
thanks a lot
here is a barebones dialog with OK and Cancel buttons. I have included the XAML, View, and ViewModel:
XAML:
Codebehind:
ViewModel
Now, you will most likely want to have your ViewModel implement INotifyPropertyChanged in the event you have other controls in your UI that will bind to properties in the ViewModel.
Hope this helps…