protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); // persist the window placement details to the user settings. SnoopWindowUtils.SaveWindowPlacement(this, wp => Properties.Settings.Default.AppChooserWindowPlacement = wp); Properties.Settings.Default.Save(); }
protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); this.Viewbox.Child = null; // persist the window placement details to the user settings. SnoopWindowUtils.SaveWindowPlacement(this, wp => Properties.Settings.Default.ZoomerWindowPlacement = wp); SnoopPartsRegistry.RemoveSnoopVisualTreeRoot(this); }
/// <summary> /// Cleanup when closing the window. /// </summary> protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); this.CurrentSelection = null; InputManager.Current.PreProcessInput -= this.HandlePreProcessInput; EventsListener.Stop(); // persist the window placement details to the user settings. SnoopWindowUtils.SaveWindowPlacement(this, wp => Properties.Settings.Default.SnoopUIWindowPlacement = wp); // persist whether all properties are shown by default Properties.Settings.Default.ShowDefaults = this.PropertyGrid.ShowDefaults; // persist whether the previewer is shown by default Properties.Settings.Default.ShowPreviewer = this.PreviewArea.IsActive; // actually do the persisting Properties.Settings.Default.Save(); SnoopPartsRegistry.RemoveSnoopVisualTreeRoot(this); }