I want to show message box in my MVVM WPF application. so from where to call MessageBox.Show().
+2
A:
Geetha
2010-09-14 04:29:35
A:
I've found that MVVM invokes a streak of OCD in programmers (I know from experience). That's a good thing. But for certain things the effort just isn't worth it, especially if it introduces an entire order of complexity just to ask the user "Are you sure you wish to xxxx?"
My opinion is that MessageBox.Show() may be called from the code-behind, but never the ViewModel. Until dialog boxes integrate better with XAML, just take the hit and don't feel bad about it. It's really a gray area of the current state of WPF UI design.
bufferz
2010-09-14 15:35:40
I am using command so if i will have to show message box after button's can execute and Execute function, i need to pass some data to view's code behind file,Then it will break mvvm.
Jeevan Bhatt
2010-09-15 04:30:07