//Run OnClosing in IClosing implementing ViewModels private void MicroscopeView_Closing(object sender, CancelEventArgs e) { IClosing context = DataContext as IClosing; if (context != null) { e.Cancel = !context.OnClosing(); } }
void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { IClosing context = DataContext as IClosing; context.OnClosing(); }