public DocumentFloatingWindow(DockingManager manager, DocumentContent content) : this(manager) { //create a new temporary pane FloatingDockablePane pane = new FloatingDockablePane(this); //setup window size Width = content.ContainerPane.ActualWidth; Height = content.ContainerPane.ActualHeight; //save current content position in container pane _previousPane = content.ContainerPane; _arrayIndexPreviousPane = _previousPane.Items.IndexOf(content); pane.SetValue(ResizingPanel.ResizeWidthProperty, _previousPane.GetValue(ResizingPanel.ResizeWidthProperty)); pane.SetValue(ResizingPanel.ResizeHeightProperty, _previousPane.GetValue(ResizingPanel.ResizeHeightProperty)); //remove content from container pane content.ContainerPane.RemoveContent(_arrayIndexPreviousPane); //add content to my temporary pane pane.Items.Add(content); //let templates access this pane HostedPane = pane; if (IsDocumentFloatingAllowed) { AllowsTransparency = false; WindowStyle = WindowStyle.ToolWindow; NotifyPropertyChanged("IsDocumentFloatingAllowed"); } }
public DockableFloatingWindow(DockingManager manager, DockablePane dockablePane) : this(manager) { //create a new temporary pane FloatingDockablePane pane = new FloatingDockablePane(this); //setup window size Width = dockablePane.ActualWidth; Height = dockablePane.ActualHeight; //save current content position in container pane _previousPane = dockablePane; _arrayIndexPreviousPane = -1; pane.SetValue(ResizingPanel.ResizeWidthProperty, _previousPane.GetValue(ResizingPanel.ResizeWidthProperty)); pane.SetValue(ResizingPanel.ResizeHeightProperty, _previousPane.GetValue(ResizingPanel.ResizeHeightProperty)); int selectedIndex = _previousPane.SelectedIndex; //remove contents from container pane and insert in hosted pane while (_previousPane.Items.Count > 0) { ManagedContent content = _previousPane.RemoveContent(0); //add content to my temporary pane pane.Items.Add(content); } //let templates access this pane HostedPane = pane; HostedPane.SelectedIndex = selectedIndex; //Change state on contents IsDockableWindow = true; }
protected override void Redock() { if (_previousPane != null) { if (_previousPane.GetManager() == null) { DockablePane newContainerPane = new DockablePane(); newContainerPane.Items.Add(HostedPane.RemoveContent(0)); newContainerPane.SetValue(ResizingPanel.ResizeWidthProperty, _previousPane.GetValue(ResizingPanel.ResizeWidthProperty)); newContainerPane.SetValue(ResizingPanel.ResizeHeightProperty, _previousPane.GetValue(ResizingPanel.ResizeHeightProperty)); if (_previousPane.Style != null) { newContainerPane.Style = _previousPane.Style; } Manager.Anchor(newContainerPane, ((DockablePane)_previousPane).Anchor); } else { if (_arrayIndexPreviousPane > _previousPane.Items.Count) { _arrayIndexPreviousPane = _previousPane.Items.Count; } DockableContent currentContent = HostedPane.Items[0] as DockableContent; _previousPane.Items.Insert(_arrayIndexPreviousPane, HostedPane.RemoveContent(0)); _previousPane.SelectedIndex = _arrayIndexPreviousPane; currentContent.SetStateToDock(); } this.Close(); } base.Redock(); }
public DockableFloatingWindow(DockingManager manager, DockableContent content) : this(manager) { //create a new temporary pane FloatingDockablePane pane = new FloatingDockablePane(this); //setup window size Width = content.ContainerPane.ActualWidth; Height = content.ContainerPane.ActualHeight; //save current content position in container pane _previousPane = content.ContainerPane; _arrayIndexPreviousPane = _previousPane.Items.IndexOf(content); pane.SetValue(ResizingPanel.ResizeWidthProperty, _previousPane.GetValue(ResizingPanel.ResizeWidthProperty)); pane.SetValue(ResizingPanel.ResizeHeightProperty, _previousPane.GetValue(ResizingPanel.ResizeHeightProperty)); //remove content from container pane content.ContainerPane.RemoveContent(_arrayIndexPreviousPane); //add content to my temporary pane pane.Items.Add(content); //let templates access this pane HostedPane = pane; //Change state on contents IsDockableWindow = true; }