Ribbon OnClosing Event

Feb 19, 2011 at 1:29 PM
Edited Feb 19, 2011 at 1:35 PM

How could I catch the OnClosing event for a ribbon window which is extended from ToolWindow?

I tried the OnClosing event but it doesn't supported by ribbon.
I need something like this method.
protected override void OnClosing(CancelEventArgs e) {
            if (viewModel.Value.SelectedHotel == null) {
                e.Cancel = true;
                switch (messageBoxResult) {
                    case MessageBoxResult.Yes:
                        e.Cancel = false;
                        break;
                    case MessageBoxResult.No:
                        e.Cancel = true;
                        break;
                }
                return;
            }
        }


Thanks