I am trying to learn MVVM, but still do not understand.
I currently 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 am wondering if I should put this logic in the ViewModel, and not directly in the view code? If so, how should I do this?
thank
Bv202 source
share