I'm trying to learn MVVM, but there is something I don't understand yet.
Currently, I have this event handler:
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
if (MessageBox.Show("Are you sure you want to close this application?", "Close??", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
{
e.Cancel = true;
}
}
Very easy. However, I would like to apply the MVVM pattern in this application.
I'm wondering, am I supposed to put this logic in a ViewModel instead of directly in the view code? If so, how am I supposed to do that?
Thanks