コード例 #1
0
        private void Window_Closing_1(Object sender, System.ComponentModel.CancelEventArgs e)
        {
            IWorkspace workspace = DataContext as IWorkspace;

            if (!workspace.Closing(e))
            {
                e.Cancel = true;
                return;
            }
            _eventAggregator.GetEvent <WindowClosingEvent>().Publish(this);
        }
コード例 #2
0
 private void Window_Closing(Object sender, CancelEventArgs e)
 {
     if (DataContext != null)
     {
         IWorkspace workspace = DataContext as IWorkspace;
         if (!workspace.Closing(e))
         {
             e.Cancel = true;
             return;
         }
         _eventAggregator.GetEvent <WindowClosingEvent>().Publish(this);
     }
 }
コード例 #3
0
 private void Window_Closing_1(Object sender, System.ComponentModel.CancelEventArgs e)
 {
     // This will be null if not proper initialized.
     if (DataContext != null)
     {
         IWorkspace workspace = DataContext as IWorkspace;
         if (!workspace.Closing(e))
         {
             e.Cancel = true;
             return;
         }
         _eventAggregator.GetEvent <WindowClosingEvent>().Publish(this);
     }
 }