WPF MVVM – Simple ‘MessageBox.Show’ With Action And Func

added by ButtonChrome
5/6/2010 4:41:11 AM

0 Kicks, 591 Views

In the MVVM world, things like message boxes (MessageBox.Show) and Dialogs (open file, save file etc), don't naturally fit. These popups are closely tied to the ‘View’ part of MVVM, but they can only really be invoked from the ‘ViewModel’ which will break the clean separation in MVVM. The solution I came up with, is to use generic Action and Func Delegates.