public void OpenToolWindow(BaseStudioControl content, bool canClose = true) { if (content == null) throw new ArgumentNullException(nameof(content)); var item = _panels.TryGetValue(content.Key); if (item == null) { item = CreatePanel(content.Key, string.Empty, content, canClose); item.SetBindings(BaseLayoutItem.CaptionProperty, content, "Title"); _panels.Add(content.Key, item); } DockCtl.ActiveLayoutItem = item; }
public void OpenToolWindow(BaseStudioControl content, bool canClose = true) { if (content == null) throw new ArgumentNullException(nameof(content)); var anchorable = _anchorables.TryGetValue(content.Key); if (anchorable == null) { anchorable = CreateAnchorable(content.Key, string.Empty, content, canClose); anchorable.SetBindings(LayoutContent.TitleProperty, content, "Title"); _anchorables.Add(content.Key, anchorable); _controlsDict[content.Key] = content; RootGroup.Children.Add(new LayoutAnchorablePane((LayoutAnchorable) anchorable)); anchorable.Float(); } DockingManager.ActiveContent = anchorable.Content; }
private void OnBaseStudioControlChanged(BaseStudioControl control) { _changedControls.Add(control); Flush(); }
public void CloseDocumentWindow(BaseStudioControl content) { if (content == null) throw new ArgumentNullException(nameof(content)); var document = _documents.TryGetValue(content.Key); if (document == null) return; document.Close(); }
public void OpenDocumentWindow(BaseStudioControl content, bool canClose = true) { if (content == null) throw new ArgumentNullException(nameof(content)); var document = _documents.TryGetValue(content.Key); if (document == null) { content.Changed += OnBaseStudioControlChanged; document = new LayoutDocument { ContentId = content.Key, Content = content, CanClose = canClose }; document.SetBindings(LayoutContent.TitleProperty, content, "Title"); _documents.Add(content.Key, document); TabGroups.First().Children.Add(document); OnBaseStudioControlChanged(content); } DockingManager.ActiveContent = document.Content; }
public void OpenToolWindow(BaseStudioControl content, bool canClose = true) { if (content == null) throw new ArgumentNullException(nameof(content)); var anchorable = _anchorables.TryGetValue(content.Key); if (anchorable == null) { content.Changed += OnBaseStudioControlChanged; anchorable = new LayoutAnchorable { ContentId = content.Key, Content = content, CanClose = canClose }; anchorable.SetBindings(LayoutContent.TitleProperty, content, "Title"); _anchorables.Add(content.Key, anchorable); RootGroup.Children.Add(new LayoutAnchorablePane(anchorable)); OnBaseStudioControlChanged(content); } DockingManager.ActiveContent = anchorable.Content; }
private SettingsStorage SaveControl(BaseStudioControl control) { var storage = new SettingsStorage(); CultureInfo.InvariantCulture.DoInCulture(() => { storage.SetValue("ControlType", control.GetType().GetTypeName(false)); control.Save(storage); }); return storage; }