private void OnDialogDeactivated(object sender, DeactivationEventArgs eventArgs) { Log.Add("Dialog deactivated"); if (eventArgs.Closed) Log.Add("Dialog closed"); }
protected override async void OnDeactivated(DeactivationEventArgs eventArgs) { base.OnDeactivated(eventArgs); // Optional: If we want to remove the strong reference to the current Item: if (eventArgs.Closed) await ActivateItemAsync(null); }
protected override void OnDeactivated(DeactivationEventArgs eventArgs) { base.OnDeactivated(eventArgs); // Optional: Remove items. This is done automatically if RemoveItemsOnCanClose or // RemoveItemsOnClose is set. if (eventArgs.Closed) Items.Clear(); }
protected override void OnDeactivated(DeactivationEventArgs eventArgs) { // Override WindowConductor and immediately close window. // (We do not use the conductor because the conductor will check CanClose and it is too // late to cancel the deactivation now.) (_windowViewModel as IActivatable)?.OnDeactivate(true); base.OnDeactivated(eventArgs); }
protected override void OnDeactivated(DeactivationEventArgs eventArgs) { base.OnDeactivated(eventArgs); if (eventArgs.Closed) { _isDirty = false; _text = null; } }
private void OnDeactivated(object sender, DeactivationEventArgs eventArgs) { if (!eventArgs.Closed) { // Do nothing if view is only hidden temporarily. return; } // Unregister event handler from view model. var activatable = _viewModel as IActivatable; if (activatable != null) { activatable.Deactivated -= OnDeactivated; } // Clear conductor. var screen = _viewModel as IScreen; if (screen != null) { screen.Conductor = null; } if (_deactivatingFromView) { // The view is already closing. return; } // Close view. _deactivateFromViewModel = true; _actuallyClosing = true; _view.Close(); _actuallyClosing = false; _deactivateFromViewModel = false; }
/// <summary> /// Raises the <see cref="Deactivated"/> event. /// </summary> /// <param name="eventArgs"> /// <see cref="DeactivationEventArgs"/> object that provides the arguments for the event. /// </param> /// <remarks> /// <strong>Notes to Inheritors:</strong> When overriding <see cref="OnDeactivated"/> in a /// derived class, be sure to call the base class's <see cref="OnDeactivated"/> method so /// that registered delegates receive the event. /// </remarks> protected virtual void OnDeactivated(DeactivationEventArgs eventArgs) { Deactivated?.Invoke(this, eventArgs); }
protected override void OnDeactivated(DeactivationEventArgs eventArgs) { (Item as IActivatable)?.OnDeactivate(eventArgs.Closed); base.OnDeactivated(eventArgs); }
private void OnDeactivated(object sender, DeactivationEventArgs eventArgs) { if (!eventArgs.Closed) { // Do nothing if view is only hidden temporarily. return; } // Unregister event handler from view model. var activatable = _viewModel as IActivatable; if (activatable != null) activatable.Deactivated -= OnDeactivated; // Clear conductor. var screen = _viewModel as IScreen; if (screen != null) screen.Conductor = null; if (_deactivatingFromView) { // The view is already closing. return; } // Close view. _deactivateFromViewModel = true; _actuallyClosing = true; _view.Close(); _actuallyClosing = false; _deactivateFromViewModel = false; }
protected override void OnDeactivated(DeactivationEventArgs eventArgs) { if (eventArgs.Closed) { // Save last used colors. Settings.Default.OldColor = OldColor; Settings.Default.NewColor = Color; } base.OnDeactivated(eventArgs); }
/// <summary> /// Raises the <see cref="Deactivated"/> event. /// </summary> /// <param name="eventArgs"> /// <see cref="DeactivationEventArgs"/> object that provides the arguments for the event. /// </param> /// <remarks> /// <strong>Notes to Inheritors:</strong> When overriding <see cref="OnDeactivated"/> in a /// derived class, be sure to call the base class's <see cref="OnDeactivated"/> method so /// that registered delegates receive the event. /// </remarks> protected virtual void OnDeactivated(DeactivationEventArgs eventArgs) { Deactivated?.Invoke(this, eventArgs); }
private void OnWindowDeactivated(object sender, DeactivationEventArgs eventArgs) { Log.Add("Window deactivated"); if (eventArgs.Closed) { _windowViewModel.Activated -= OnWindowActivated; _windowViewModel.Deactivated -= OnWindowDeactivated; _windowViewModel = null; Log.Add("Window closed"); } RefreshButtons(); }
protected override void OnDeactivated(DeactivationEventArgs eventArgs) { if (eventArgs.Closed) { PropertyChangedEventManager.RemoveHandler(Document, OnDocumentPropertyChanged, string.Empty); Document.UnregisterViewModel(this); // The last view model closes the document. if (!Document.IsDisposed && !Document.ViewModels.Any()) Document.DocumentService.Close(Document, true); } base.OnDeactivated(eventArgs); }
private void OnEditorDeactivated(object sender, DeactivationEventArgs eventArgs) { if (eventArgs.Closed) { Editor.Window.DragEnter -= OnDragEnter; Editor.Window.Drop -= OnDrop; } }
protected override void OnDeactivated(DeactivationEventArgs eventArgs) { UpdateTimer(); if (eventArgs.Closed) { //PropertySource = null; _timer = null; } base.OnDeactivated(eventArgs); }
/// <inheritdoc/> protected override void OnDeactivated(DeactivationEventArgs eventArgs) { Logger.Debug("Deactivating {0} (\"{1}\").", GetType().Name, DisplayName); base.OnDeactivated(eventArgs); }
protected override void OnDeactivated(DeactivationEventArgs eventArgs) { if (eventArgs.Closed) { _gameExtension.GameLogicUpdating -= OnGameLogicUpdating; _gameExtension = null; Document.PropertyChanged -= OnDocumentPropertyChanged; Reset(true, true); } base.OnDeactivated(eventArgs); }
protected override void OnDeactivated(DeactivationEventArgs eventArgs) { if (eventArgs.Closed) { // Close all items. var dockTabItems = this.GetDockElements() .OfType<IDockTabItem>() .Distinct(); foreach (var dockTabItem in dockTabItems) { (dockTabItem as IActivatable)?.OnDeactivate(true); var screen = dockTabItem as IScreen; if (screen != null) screen.Conductor = null; } } else { // Deactivate all selected items. this.GetDockElements() .OfType<IDockTabPane>() .Where(dockTabPane => dockTabPane.IsVisible) .Select(dockTabPane => dockTabPane.SelectedItem) .OfType<IActivatable>() .ForEach(activatable => activatable.OnDeactivate(false)); } base.OnDeactivated(eventArgs); }
protected override void OnDeactivated(DeactivationEventArgs eventArgs) { if (eventArgs.Closed) { // Dispose graphics screens. foreach (var graphicsScreen in GraphicsScreens) graphicsScreen.SafeDispose(); GraphicsScreens = null; } base.OnDeactivated(eventArgs); }
protected override void OnDeactivated(DeactivationEventArgs eventArgs) { (Item as IActivatable)?.OnDeactivate(eventArgs.Closed); base.OnDeactivated(eventArgs); }
protected override void OnDeactivated(DeactivationEventArgs eventArgs) { if (eventArgs.Closed) { Items.OfType<IActivatable>().ForEach(item => item.OnDeactivate(true)); if (RemoveItemsOnClose) { Items.OfType<IScreen>().ForEach(item => item.Conductor = null); Items.Clear(); } } else { Items.OfType<IActivatable>().ForEach(item => item.OnDeactivate(false)); } base.OnDeactivated(eventArgs); }