public bool TryGetPanelInfo( IPanel panel, out PanelInfo panelInfo) { var result = false; if (panel != null) { panelInfo = openPanels.Find(info => info.Panel == panel); result = panelInfo != null; } else { panelInfo = null; } return(result); }
private void Add( IPanel panel) { Requires.NotNull(panel, nameof(panel)); var panelInfo = openPanels.Find(info => info.Panel == panel); if (panelInfo != null) { openPanels.Remove(panelInfo); openPanels.Add(panelInfo); } else { panelInfo = new PanelInfo(panel, Modes.None); openPanels.Add(panelInfo); } }
private void AddModal( IPanel panel) { Requires.NotNull(panel, nameof(panel)); var panelInfo = openPanels.Find(info => info.Panel == panel); if (panelInfo != null) { openPanels.Remove(panelInfo); } panelInfo = new PanelInfo(panel, Modes.Modal); foreach (var info in openPanels) { info.Panel.IsInteractable = false; } openPanels.Add(panelInfo); }