public override void DisplayVisualTree() { AutomationElement rootAutomationElement = this.RootAutomationElement; if (w != null) { w.Closing -= W_Closing; avv = null; w = null; } avv = new UIVisualViewer.UIVisualViewer(ApplicationName); avv.LoadTree(rootAutomationElement); w = new Window(); w.Closing += W_Closing; w.Content = avv; w.Show(); }
private void W_Closing(object sender, System.ComponentModel.CancelEventArgs e) { w = null; avv = null; }