示例#1
0
        private void DockingManager_OnActiveContentChanged(object sender, EventArgs e)
        {
            DocumentView      document          = DockingManager.ActiveContent as DocumentView;
            DocumentViewModel documentViewModel = document?.DataContext as DocumentViewModel;

            if (documentViewModel != null)
            {
                _viewModel.ActiveDocument = documentViewModel;
            }
        }
示例#2
0
        private void Document_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            var result = MessageBox.Show(this, "Do you want to save before exit?", "Close document", MessageBoxButton.YesNoCancel);

            if (result == MessageBoxResult.Cancel)
            {
                e.Cancel = true;
            }
            else
            {
                GraphDocument document = sender as GraphDocument;
                DocumentView  view     = document.Content as DocumentView;
                _viewModel.RemoveDocument(view.DataContext as DocumentViewModel);
                document.Closing -= Document_Closing;
            }
        }
示例#3
0
 private void PoolView_Loaded(object sender, RoutedEventArgs e)
 {
     _documentView = VisualHelper.FindParent <DocumentView>(this);
 }