Example #1
0
        private void ContentDockingManager_OnDocumentClosing(object sender, DocumentClosingEventArgs e)
        {
            e.Document.CanClose = false;

            var documentModel = e.Document.Content as SentenceEditorView;
            if (documentModel != null)
            {
                Dispatcher.BeginInvoke(new Action(() => viewModel.SentenceEditViews.Remove(documentModel)),
                    DispatcherPriority.Background);
            }
        }
		void LayoutPartClosing(object sender, DocumentClosingEventArgs e)
		{
			var layoutPartViewModel = e.Document.Content as LayoutPartViewModel;
			if (layoutPartViewModel != null)
			{
				LayoutParts.Remove(layoutPartViewModel);
				e.Cancel = true;
			}
		}
 private void dockManager_DocumentClosing(object sender, DocumentClosingEventArgs e)
 {
     if (MessageBox.Show("Are you sure you want to close the document?", "AvalonDock Sample", MessageBoxButton.YesNo) == MessageBoxResult.No)
         e.Cancel = true;
 }
Example #4
0
		private void OnDockingManagerDocumentClosing(object sender, DocumentClosingEventArgs e)
		{
			var control = e.Document.Content as BaseStudioControl;

			if (control == null)
				return;

			e.Cancel = !control.CanClose();
		}
Example #5
0
 private void DocumentClosingExecute(DocumentClosingEventArgs arg)
 {
     // eventuellement des cancel
 }
        internal void _ExecuteCloseCommand(LayoutDocument document)
        {
            if (DocumentClosing != null)
            {
                var evargs = new DocumentClosingEventArgs(document);
                DocumentClosing(this, evargs);
                if (evargs.Cancel)
                    return;
            }

            if (!document.TestCanClose())
                return;

            document.Close();

            if (DocumentClosed != null)
            {
                var evargs = new DocumentClosedEventArgs(document);
                DocumentClosed(this, evargs);
            }
        }
 private void OnDocumentClosing(object sender, DocumentClosingEventArgs documentClosingEventArgs)
 {
     //documentClosingEventArgs.Document.Content
     Debug.WriteLine("Closing Tab");
 }
 private async void OnDocumentClosing(object sender, DocumentClosingEventArgs args)
 {
     args.Cancel = true;
     await Model.CloseDocumentAsync((JsonDocumentModel)args.Document.Content);
 }