/// <summary> /// Close a panel when it is being hidden. /// </summary> /// <param name="hidePanelEvent"> /// The <see cref="HidePanelEvent"/> /// </param> private void CloseHiddenPanel(HidePanelEvent hidePanelEvent) { var allBrowsers = this.GetAllOpenBrowsers().SelectMany(x => x); var browser = allBrowsers.SingleOrDefault(x => x.Identifier == hidePanelEvent.Identifier); if (browser != null) { this.PanelNavigationService.CloseInAddIn(browser); if (this.openElementDefinitionBrowsers.Contains(browser)) { this.openElementDefinitionBrowsers.Remove(browser as ElementDefinitionsBrowserViewModel); } else if (this.openOptionBrowsers.Contains(browser)) { this.openOptionBrowsers.Remove(browser as OptionBrowserViewModel); } else if (this.openFiniteStateBrowsers.Contains(browser)) { this.openFiniteStateBrowsers.Remove(browser as FiniteStateBrowserViewModel); } else if (this.openPublicationBrowsers.Contains(browser)) { this.openPublicationBrowsers.Remove(browser as PublicationBrowserViewModel); } } }
/// <summary> /// Handles a <see cref="CustomTaskPane"/>'s VisibleStateChangeEvent /// </summary> /// <param name="customTaskPaneInst"> /// The <see cref="_CustomTaskPane"/> /// </param> private void CustomTaskPane_VisibleStateChangeEvent(_CustomTaskPane customTaskPaneInst) { if (customTaskPaneInst.Visible) { return; } var identifier = this.customTaskPanes.SingleOrDefault(x => x.Value.CustomTaskPane == customTaskPaneInst).Key; var hidePanelEvent = new HidePanelEvent(identifier); CDPMessageBus.Current.SendMessage(hidePanelEvent); }
/// <summary> /// Close a panel when it is being hidden. /// </summary> /// <param name="hidePanelEvent"> /// The <see cref="HidePanelEvent"/> /// </param> private void CloseHiddenPanel(HidePanelEvent hidePanelEvent) { var allBrowsers = this.GetAllOpenBrowsers().SelectMany(x => x); var browser = allBrowsers.SingleOrDefault(x => x.Identifier == hidePanelEvent.Identifier); if (browser != null) { this.PanelNavigationService.CloseInAddIn(browser); if (this.openProductTree.Contains(browser)) { this.openProductTree.Remove(browser as ProductTreeViewModel); } } }
protected void InvokeHidePanel(UIPanelType type, bool forceDeactivate = false) { HidePanelEvent?.Invoke(type, forceDeactivate); }
public void InvokeHidePanel() { HidePanelEvent?.Invoke(PanelType, false); }
public void InvokeHidePanel(bool forceDeactivate) { HidePanelEvent?.Invoke(PanelType, forceDeactivate); }