void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.dockManager = ((AvalonDock.DockingManager)(target)); return; case 2: this.SideBarExplorer = ((AvalonDock.DockablePane)(target)); return; case 3: this.MainComponentContainer = ((AvalonDock.DocumentPane)(target)); return; case 4: this.errorsContent = ((AvalonDock.DockableContent)(target)); return; case 5: this.output = ((AvalonDock.DockableContent)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 8 "..\..\Window4.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; case 2: this.dockingManager = ((AvalonDock.DockingManager)(target)); #line 10 "..\..\Window4.xaml" this.dockingManager.Loaded += new System.Windows.RoutedEventHandler(this.dockingManager_Loaded); #line default #line hidden #line 10 "..\..\Window4.xaml" this.dockingManager.RequestDocumentClose += new System.EventHandler <AvalonDock.RequestDocumentCloseEventArgs>(this.dockingManager_RequestDocumentClose); #line default #line hidden return; case 3: this._documentHost = ((AvalonDock.DocumentPane)(target)); return; } this._contentLoaded = true; }
protected override void OnInitialized(EventArgs e) { //setup window size _floatingWindow.Width = _documentToTransfer.ContainerPane.ActualWidth; _floatingWindow.Height = _documentToTransfer.ContainerPane.ActualHeight; //save current content position in container pane _previousPane = _documentToTransfer.ContainerPane as DocumentPane; _arrayIndexPreviousPane = _previousPane.Items.IndexOf(_documentToTransfer); SetValue(ResizingPanel.ResizeWidthProperty, _previousPane.GetValue(ResizingPanel.ResizeWidthProperty)); SetValue(ResizingPanel.ResizeHeightProperty, _previousPane.GetValue(ResizingPanel.ResizeHeightProperty)); //Style = _previousPane.Style; AttachStyleFromPane(_previousPane); //remove content from container pane _previousPane.RemoveContent(_arrayIndexPreviousPane); //add content to my temporary pane Items.Add(_documentToTransfer); _documentToTransfer.SetIsFloating(true); base.OnInitialized(e); }
public void AdapterAssociatesDocumentPaneWithRegion() { var documentPane = new DocumentPane(); IRegionAdapter adapter = new DocumentPaneRegionAdapter(null); IRegion region = adapter.Initialize(documentPane, "Region1"); Assert.IsNotNull(region); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.DocumentManager = ((AvalonDock.DocumentPane)(target)); return; } this._contentLoaded = true; }
void AttachStyleFromPane(DocumentPane copyFromPane) { if (copyFromPane == null) return; //Binding bnd = new Binding("Style"); //bnd.Source = copyFromPane; //bnd.Mode = BindingMode.OneWay; //SetBinding(StyleProperty, bnd); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.dockManager = ((AvalonDock.DockingManager)(target)); return; case 2: this.documentsHost = ((AvalonDock.DocumentPane)(target)); return; } this._contentLoaded = true; }
protected override void OnInitialized(EventArgs e) { _previousPane = _documentToTransfer.ContainerPane as DocumentPane; if (_documentToTransfer != null && _documentToTransfer.FloatingWindowSize.IsEmpty) { if (_previousPane != null) _documentToTransfer.FloatingWindowSize = new Size(_previousPane.ActualWidth, _previousPane.ActualHeight); else _documentToTransfer.FloatingWindowSize = new Size(400.0, 400.0); } if (_documentToTransfer != null && !_documentToTransfer.FloatingWindowSize.IsEmpty) { _floatingWindow.Width = _documentToTransfer.FloatingWindowSize.Width; _floatingWindow.Height = _documentToTransfer.FloatingWindowSize.Height; } if (_previousPane != null) { //setup window size _floatingWindow.Width = _documentToTransfer.ContainerPane.ActualWidth; _floatingWindow.Height = _documentToTransfer.ContainerPane.ActualHeight; //save current content position in container pane _arrayIndexPreviousPane = _previousPane.Items.IndexOf(_documentToTransfer); SetValue(ResizingPanel.ResizeWidthProperty, _previousPane.GetValue(ResizingPanel.ResizeWidthProperty)); SetValue(ResizingPanel.ResizeHeightProperty, _previousPane.GetValue(ResizingPanel.ResizeHeightProperty)); //Style = _previousPane.Style; AttachStyleFromPane(_previousPane); //remove content from container pane _previousPane.RemoveContent(_arrayIndexPreviousPane); } //add content to my temporary pane Items.Add(_documentToTransfer); _documentToTransfer.SetIsFloating(true); LayoutTransform = (MatrixTransform)_documentToTransfer.TansformToAncestor(); base.OnInitialized(e); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.dockManager = ((AvalonDock.DockingManager)(target)); return; case 2: this.SideBarExplorer = ((AvalonDock.DockablePane)(target)); #line 7 "..\..\Panels.xaml" this.SideBarExplorer.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.SideBarExplorerSelectionChanged); #line default #line hidden return; case 3: this.MainComponentContainer = ((AvalonDock.DocumentPane)(target)); #line 8 "..\..\Panels.xaml" this.MainComponentContainer.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.MainComponentContainerSelectionChanged); #line default #line hidden return; case 4: this.BottomBar = ((AvalonDock.DockablePane)(target)); return; case 5: this.errorPane = ((AvalonDock.DockableContent)(target)); return; case 6: this.outputPane = ((AvalonDock.DockableContent)(target)); return; case 7: this.listView1 = ((System.Windows.Controls.ListView)(target)); return; } this._contentLoaded = true; }
public override Pane ClonePane() { DocumentPane paneToAnchor = new DocumentPane(); ResizingPanel.SetEffectiveSize(paneToAnchor, new Size(Width, Height)); //transfer contents from hosted pane in the floating window and //the new created dockable pane while (HostedPane.Items.Count > 0) { paneToAnchor.Items.Add( HostedPane.RemoveContent(0)); } paneToAnchor.ApplyTemplate(); return paneToAnchor; }
public DocumentPane CreateNewHorizontalTabGroup() { var activeContent = SelectedItem as ManagedContent; var oldContainerPane = activeContent.ContainerPane as DocumentPane; var newContainerPane = new DocumentPane(); oldContainerPane.RemoveContent(activeContent); newContainerPane.Items.Add(activeContent); GetManager().Anchor(newContainerPane, this, AnchorStyle.Bottom); activeContent.Activate(); newContainerPane.RefreshContainsActiveContentProperty(); newContainerPane.RefreshContainsActiveDocumentProperty(); oldContainerPane.RefreshContainsActiveContentProperty(); oldContainerPane.RefreshContainsActiveDocumentProperty(); return(newContainerPane); }
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; if (content.FloatingWindowSize.IsEmpty) { content.FloatingWindowSize = new Size(content.ContainerPane.ActualWidth, content.ContainerPane.ActualHeight); } Width = content.FloatingWindowSize.Width; Height = content.FloatingWindowSize.Height; //save current content position in container pane _previousPane = content.ContainerPane; _arrayIndexPreviousPane = _previousPane.Items.IndexOf(content); pane.Style = content.ContainerPane.Style; //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; DocumentPane originalDocumentPane = _previousPane as DocumentPane; if (originalDocumentPane != null) { originalDocumentPane.CheckContentsEmpty(); } }
public void ExecutedActivateDocumentCommand(object sender, ExecutedRoutedEventArgs e) { ManagedContent doc = e.Parameter as ManagedContent; if (doc != null) { if (!DocumentTabPanel.GetIsHeaderVisible(doc)) { DocumentPane parentPane = doc.ContainerPane as DocumentPane; parentPane.Items.Remove(doc); parentPane.Items.Insert(0, doc); } ////doc.IsSelected = true; ////Selector.SetIsSelected(doc, true); //if (this.GetManager() != null) // this.GetManager().ActiveContent = doc; doc.SetAsActive(); } }
public override Pane ClonePane() { DocumentPane paneToAnchor = new DocumentPane(); ////transfer the resizing panel sizes //paneToAnchor.SetValue(ResizingPanel.ResizeWidthProperty, // HostedPane.GetValue(ResizingPanel.ResizeWidthProperty)); //paneToAnchor.SetValue(ResizingPanel.ResizeHeightProperty, // HostedPane.GetValue(ResizingPanel.ResizeHeightProperty)); //transfer contents from hosted pane in the floating window and //the new created dockable pane while (HostedPane.Items.Count > 0) { paneToAnchor.Items.Add( HostedPane.RemoveContent(0)); } return(paneToAnchor); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 12 "..\..\..\Window1.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click); #line default #line hidden return; case 2: this.dockManager = ((AvalonDock.DockingManager)(target)); return; case 3: this.resizeScenarioPanel = ((AvalonDock.ResizingPanel)(target)); return; case 4: this.scenarioDocumentPane = ((AvalonDock.DocumentPane)(target)); return; case 5: this.messagesDockPane = ((AvalonDock.DockablePane)(target)); return; case 6: this.messagesPane = ((AvalonDock.DockableContent)(target)); return; case 7: this.txtMessages = ((System.Windows.Controls.TextBox)(target)); return; } this._contentLoaded = true; }
/// <summary> /// Close this document removing it from its parent container /// </summary> /// <remarks>Use this function to close a document and remove it from its parent container. Please note /// that if you simply remove it from its parent <see cref="DocumentPane"/> without call this method, events like /// <see cref="OnClosing"/>/<see cref="OnClosed"/> are not called. /// <para> /// Note:<see cref="DockableContent"/> cannot be closed: AvalonDock simply hide a <see cref="DockableContent"/> removing all the reference to it. /// </para> /// </remarks> public void Close() { CancelEventArgs e = new CancelEventArgs(false); OnClosing(e); if (e.Cancel) { return; } DocumentPane parentPane = ContainerPane as DocumentPane; if (parentPane != null) { parentPane.Items.Remove(this); parentPane.CheckContentsEmpty(); } OnClosed(); }
/// <summary> /// Close this content without notifications /// </summary> internal void InternalClose() { DocumentPane parentPane = ContainerPane as DocumentPane; DockingManager manager = Manager; if (manager != null) { if (manager.ActiveContent == this) { manager.ActiveContent = null; } if (manager.ActiveDocument == this) { manager.ActiveDocument = null; } } if (parentPane != null) { parentPane.Items.Remove(this); parentPane.CheckContentsEmpty(); } else { FloatingDockablePane floatingParentPane = ContainerPane as FloatingDockablePane; if (floatingParentPane != null) { floatingParentPane.RemoveContent(0); if (floatingParentPane.FloatingWindow != null && !floatingParentPane.FloatingWindow.IsClosing) { floatingParentPane.FloatingWindow.Close(); } } } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.DockManager = ((AvalonDock.DockingManager)(target)); return; case 2: this.VerticalResizingPanel = ((AvalonDock.ResizingPanel)(target)); return; case 3: this.HorizontalResizingPanel = ((AvalonDock.ResizingPanel)(target)); return; case 4: this.DesignerDockablePane = ((AvalonDock.DocumentPane)(target)); return; case 5: this.Placeholder1 = ((AvalonDock.DockablePane)(target)); return; case 6: this.Placeholder2 = ((AvalonDock.DockablePane)(target)); return; case 7: this.TabsPane = ((AvalonDock.DockablePane)(target)); return; case 8: this.Status = ((System.Windows.Controls.TextBlock)(target)); return; } this._contentLoaded = true; }
/// <summary> /// Close this content without notifications /// </summary> internal void InternalClose() { this.LastActivation = DateTime.MinValue; // make this content ineligible for ActiveDocument selection when ActiveDocument is set to null DockingManager manager = Manager; if (manager != null) { if (manager.ActiveContent == this) { manager.ActiveContent = null; } if (manager.ActiveDocument == this) { manager.ActiveDocument = null; } } DocumentPane parentPane = ContainerPane as DocumentPane; FloatingDocumentPane floatingParentPane = ContainerPane as FloatingDocumentPane; if (floatingParentPane != null) { floatingParentPane.RemoveContent(0); if (floatingParentPane.FloatingWindow != null && !floatingParentPane.FloatingWindow.IsClosing) { floatingParentPane.FloatingWindow.Close(); } } else if (parentPane != null) { parentPane.Items.Remove(this); parentPane.CheckContentsEmpty(); } }
/// <summary> /// Activate the document showing its header if it's not visible /// </summary> /// sua ngay 25/10 /// public override void Activate() { base.Activate(); //chi cho phep hien thi 1 documentconten nen luon dat o vitri=0 các document hiện tại if (!DocumentTabPanel.GetIsHeaderVisible(this)) { DocumentPane parentPane = this.ContainerPane as DocumentPane; if (parentPane != null && parentPane.GetManager() != null && parentPane.Items.IndexOf(this) != 0) { parentPane.Items.Remove(this); parentPane.Items.Insert(0, this); parentPane.SelectedIndex = 0; } } //Active this content as the active document if (Manager != null) { Manager.ActiveDocument = this; } //ensure this content is rendered first Panel.SetZIndex(this, 2); }
protected override void OnInitialized(EventArgs e) { if (_paneToTransfer != null) { //setup window size ManagedContent selectedContent = _paneToTransfer.SelectedItem as ManagedContent; if (selectedContent is DockableContent) { _floatingWindow.SizeToContent = (selectedContent as DockableContent).FloatingWindowSizeToContent; } if (selectedContent != null && selectedContent.FloatingWindowSize.IsEmpty) { selectedContent.FloatingWindowSize = new Size(_paneToTransfer.ActualWidth, _paneToTransfer.ActualHeight); } if (selectedContent != null) { _floatingWindow.Width = selectedContent.FloatingWindowSize.Width; _floatingWindow.Height = selectedContent.FloatingWindowSize.Height; } else { _floatingWindow.Width = _paneToTransfer.ActualWidth; _floatingWindow.Height = _paneToTransfer.ActualHeight; } int selectedIndex = _paneToTransfer.SelectedIndex; //remove contents from container pane and insert in hosted pane while (_paneToTransfer.Items.Count > 0) { DockableContent contentToTranser = _paneToTransfer.Items[0] as DockableContent; contentToTranser.SaveCurrentStateAndPosition(); _paneToTransfer.RemoveContent(0); //add content to my temporary pane Items.Add(contentToTranser); contentToTranser.SetStateToDockableWindow(); } SelectedIndex = selectedIndex; //transfer the style from the original dockablepane //Style = _paneToTransfer.Style; AttachStyleFromPane(_paneToTransfer); ApplyTemplate(); LayoutTransform = (MatrixTransform)_paneToTransfer.TansformToAncestor(); } else if (_contentToTransfer != null) { //setup window size if (_contentToTransfer.FloatingWindowSize.IsEmpty) { _contentToTransfer.FloatingWindowSize = new Size(_contentToTransfer.ContainerPane.ActualWidth, _contentToTransfer.ContainerPane.ActualHeight); } _floatingWindow.Width = _contentToTransfer.FloatingWindowSize.Width; _floatingWindow.Height = _contentToTransfer.FloatingWindowSize.Height; //save current content position in container pane _previousPane = _contentToTransfer.ContainerPane; _arrayIndexPreviousPane = _previousPane.Items.IndexOf(_contentToTransfer); _contentToTransfer.SaveCurrentStateAndPosition(); //remove content from container pane _contentToTransfer.ContainerPane.RemoveContent(_arrayIndexPreviousPane); //add content to this pane Items.Add(_contentToTransfer); SelectedIndex = 0; AttachStyleFromPane(_previousPane as DockablePane); DocumentPane originalDocumentPane = _previousPane as DocumentPane; if (originalDocumentPane != null) { originalDocumentPane.CheckContentsEmpty(); } _contentToTransfer.SetStateToDockableWindow(); LayoutTransform = (MatrixTransform)_contentToTransfer.TansformToAncestor(); } base.OnInitialized(e); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 6 "..\..\Demo.xaml" ((AvalonDockTest.Demo)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing); #line default #line hidden #line 6 "..\..\Demo.xaml" ((AvalonDockTest.Demo)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded); #line default #line hidden return; case 2: this.ShowDockingManager = ((System.Windows.Controls.MenuItem)(target)); #line 90 "..\..\Demo.xaml" this.ShowDockingManager.Click += new System.Windows.RoutedEventHandler(this.ShowDockingManager_Checked); #line default #line hidden return; case 3: #line 91 "..\..\Demo.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor_Clicked); #line default #line hidden return; case 4: #line 92 "..\..\Demo.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor_Clicked); #line default #line hidden return; case 5: #line 93 "..\..\Demo.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor_Clicked); #line default #line hidden return; case 6: #line 94 "..\..\Demo.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor_Clicked); #line default #line hidden return; case 7: #line 95 "..\..\Demo.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor_Clicked); #line default #line hidden return; case 8: #line 96 "..\..\Demo.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor_Clicked); #line default #line hidden return; case 9: #line 97 "..\..\Demo.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor_Clicked); #line default #line hidden return; case 10: #line 99 "..\..\Demo.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ResetColors_Clicked); #line default #line hidden return; case 11: this.TestContainer = ((System.Windows.Controls.ContentControl)(target)); return; case 12: this._dockingManager = ((AvalonDock.DockingManager)(target)); return; case 13: this._propertiesWindow = ((AvalonDock.DockableContent)(target)); return; case 14: this._documentsHost = ((AvalonDock.DocumentPane)(target)); return; case 15: this.docHome = ((AvalonDock.DocumentContent)(target)); #line 124 "..\..\Demo.xaml" this.docHome.Closing += new System.EventHandler <System.ComponentModel.CancelEventArgs>(this.doc_Closing); #line default #line hidden return; case 16: this.NewDocuments = ((System.Windows.Documents.Hyperlink)(target)); #line 194 "..\..\Demo.xaml" this.NewDocuments.Click += new System.Windows.RoutedEventHandler(this.NewDocuments_Click); #line default #line hidden return; case 17: this.ShowProperties = ((System.Windows.Documents.Hyperlink)(target)); #line 196 "..\..\Demo.xaml" this.ShowProperties.Click += new System.Windows.RoutedEventHandler(this.ShowProperties_Click); #line default #line hidden return; case 18: this.ShowProperties_AutoHide = ((System.Windows.Documents.Hyperlink)(target)); #line 197 "..\..\Demo.xaml" this.ShowProperties_AutoHide.Click += new System.Windows.RoutedEventHandler(this.ShowProperties_Click); #line default #line hidden return; case 19: this.ShowProperties_FloatingWindow = ((System.Windows.Documents.Hyperlink)(target)); #line 198 "..\..\Demo.xaml" this.ShowProperties_FloatingWindow.Click += new System.Windows.RoutedEventHandler(this.ShowProperties_Click); #line default #line hidden return; case 20: this.ShowExplorer = ((System.Windows.Documents.Hyperlink)(target)); #line 200 "..\..\Demo.xaml" this.ShowExplorer.Click += new System.Windows.RoutedEventHandler(this.ShowExplorer_Click); #line default #line hidden return; case 21: this.ShowExplorer_AutoHide = ((System.Windows.Documents.Hyperlink)(target)); #line 201 "..\..\Demo.xaml" this.ShowExplorer_AutoHide.Click += new System.Windows.RoutedEventHandler(this.ShowExplorer_Click); #line default #line hidden return; case 22: this.ShowExplorer_FloatingWindow = ((System.Windows.Documents.Hyperlink)(target)); #line 202 "..\..\Demo.xaml" this.ShowExplorer_FloatingWindow.Click += new System.Windows.RoutedEventHandler(this.ShowExplorer_Click); #line default #line hidden return; case 23: this.ShowEventsLog = ((System.Windows.Documents.Hyperlink)(target)); #line 204 "..\..\Demo.xaml" this.ShowEventsLog.Click += new System.Windows.RoutedEventHandler(this.ShowEventsLog_Click); #line default #line hidden return; case 24: this.ShowEventsLog_AutoHide = ((System.Windows.Documents.Hyperlink)(target)); #line 205 "..\..\Demo.xaml" this.ShowEventsLog_AutoHide.Click += new System.Windows.RoutedEventHandler(this.ShowEventsLog_Click); #line default #line hidden return; case 25: this.ShowEventsLog_FloatingWindow = ((System.Windows.Documents.Hyperlink)(target)); #line 206 "..\..\Demo.xaml" this.ShowEventsLog_FloatingWindow.Click += new System.Windows.RoutedEventHandler(this.ShowEventsLog_Click); #line default #line hidden return; case 26: this.ShowEventsLog_DockRight = ((System.Windows.Documents.Hyperlink)(target)); #line 207 "..\..\Demo.xaml" this.ShowEventsLog_DockRight.Click += new System.Windows.RoutedEventHandler(this.ShowEventsLog_Click); #line default #line hidden return; case 27: this.ShowProperty = ((System.Windows.Documents.Hyperlink)(target)); #line 209 "..\..\Demo.xaml" this.ShowProperty.Click += new System.Windows.RoutedEventHandler(this.ShowProperty_Click); #line default #line hidden return; case 28: this.ShowProperty_AutoHide = ((System.Windows.Documents.Hyperlink)(target)); #line 210 "..\..\Demo.xaml" this.ShowProperty_AutoHide.Click += new System.Windows.RoutedEventHandler(this.ShowProperty_Click); #line default #line hidden return; case 29: this.ShowProperty_FloatingWindow = ((System.Windows.Documents.Hyperlink)(target)); #line 211 "..\..\Demo.xaml" this.ShowProperty_FloatingWindow.Click += new System.Windows.RoutedEventHandler(this.ShowProperty_Click); #line default #line hidden return; case 30: this.ShowProperty_DockRight = ((System.Windows.Documents.Hyperlink)(target)); #line 212 "..\..\Demo.xaml" this.ShowProperty_DockRight.Click += new System.Windows.RoutedEventHandler(this.ShowProperty_Click); #line default #line hidden return; case 31: this.SaveLayout = ((System.Windows.Documents.Hyperlink)(target)); #line 214 "..\..\Demo.xaml" this.SaveLayout.Click += new System.Windows.RoutedEventHandler(this.SaveLayout_Click); #line default #line hidden return; case 32: this.RestoreLayout = ((System.Windows.Documents.Hyperlink)(target)); #line 215 "..\..\Demo.xaml" this.RestoreLayout.Click += new System.Windows.RoutedEventHandler(this.RestoreLayout_Click); #line default #line hidden return; case 33: this._objectExplorerHost = ((AvalonDock.DockableContent)(target)); return; case 34: this._errorList = ((AvalonDockTest.ErrorListContent)(target)); return; case 35: this._eventsLogWindow = ((AvalonDock.DockableContent)(target)); return; case 36: this._txtLog = ((System.Windows.Controls.TextBox)(target)); return; case 37: this._explorerWindow = ((AvalonDock.DockableContent)(target)); return; case 38: this.tabControl = ((System.Windows.Controls.TabControl)(target)); return; case 39: this.ButtonDefault = ((System.Windows.Controls.Button)(target)); #line 271 "..\..\Demo.xaml" this.ButtonDefault.Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; case 40: this.ButtonDefault2 = ((System.Windows.Controls.Button)(target)); #line 275 "..\..\Demo.xaml" this.ButtonDefault2.Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; case 41: this.ButtonDefault3 = ((System.Windows.Controls.Button)(target)); #line 276 "..\..\Demo.xaml" this.ButtonDefault3.Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; } this._contentLoaded = true; }
/// <summary> /// Anchor a dockable pane (<see cref="DockablePane"/>) to a border of a document pane /// </summary> /// <param name="paneToAnchor">Pane to anchor</param> /// <param name="relativePane">Pane relative</param> /// <param name="anchor"></param> public void Anchor(DockablePane paneToAnchor, DocumentPane relativePane, AnchorStyle anchor) { //ensure that content property is not empty EnsureContentNotEmpty(); if (anchor == AnchorStyle.None) anchor = AnchorStyle.Right; //get a reference to the resizingpanel container of relativePane ResizingPanel relativePaneContainer = LogicalTreeHelper.GetParent(relativePane) as ResizingPanel; DocumentPaneResizingPanel relativeDocumentPaneContainer = relativePane.GetParentDocumentPaneResizingPanel(); Orientation requestedOrientation = (anchor == AnchorStyle.Bottom || anchor == AnchorStyle.Top) ? Orientation.Vertical : Orientation.Horizontal; if (relativePaneContainer == null) { Debug.Assert(relativePane.Parent == this); this.Content = null; relativeDocumentPaneContainer = new DocumentPaneResizingPanel(); relativeDocumentPaneContainer.Children.Add(relativePane); relativePaneContainer = new ResizingPanel(); relativePaneContainer.Orientation = requestedOrientation; this.Content = relativePaneContainer; relativePaneContainer.Children.Add(relativeDocumentPaneContainer); } if (relativeDocumentPaneContainer == null) { relativeDocumentPaneContainer = new DocumentPaneResizingPanel(); relativeDocumentPaneContainer.Orientation = requestedOrientation; int indexOfPaneToReplace = relativePaneContainer.Children.IndexOf(relativePane); relativePaneContainer.Children.RemoveAt(indexOfPaneToReplace); relativeDocumentPaneContainer.Children.Add(relativePane); relativePaneContainer.Children.Insert(indexOfPaneToReplace, relativeDocumentPaneContainer); } relativePaneContainer = LogicalTreeHelper.GetParent(relativeDocumentPaneContainer) as ResizingPanel; //Debug.Assert(relativePaneContainer is DocumentPaneResizingPanel, "By now we can't have a pane without a resizing panel containing it"); if (relativePaneContainer == null) { Debug.Assert(relativeDocumentPaneContainer.Parent == this); this.Content = null; relativePaneContainer = new ResizingPanel(); relativePaneContainer.Orientation = requestedOrientation; this.Content = relativePaneContainer; relativePaneContainer.Children.Add(relativeDocumentPaneContainer); } #region Create and setup container panel if (relativePaneContainer != null) { //check if orientation is right if (relativePaneContainer.Orientation != requestedOrientation) { //if the existing panel is not oriented as we want //create a new one ResizingPanel newPanel = new ResizingPanel(); newPanel.Orientation = requestedOrientation; if (newPanel.Orientation == Orientation.Horizontal) ResizingPanel.SetResizeHeight(newPanel, ResizingPanel.GetResizeHeight(relativePane)); else ResizingPanel.SetResizeWidth(newPanel, ResizingPanel.GetResizeWidth(relativePane)); //replace relative pane in its' container panel //with this new panel int indexofRelativePane = relativePaneContainer.Children.IndexOf(relativeDocumentPaneContainer); relativePaneContainer.Children.Remove(relativeDocumentPaneContainer); relativePaneContainer.Children.Insert(indexofRelativePane, newPanel); //now we have a panel correctly placed in the tree newPanel.Children.Add(relativeDocumentPaneContainer); //use InsertChildRelativeTo function to add a resizingsplitter between //the two children newPanel.InsertChildRelativeTo( paneToAnchor, relativeDocumentPaneContainer, anchor == AnchorStyle.Right || anchor == AnchorStyle.Bottom); } else { if (anchor == AnchorStyle.Left || anchor == AnchorStyle.Top) { //add new child before first (prepend) relativePaneContainer.InsertChildRelativeTo(paneToAnchor, relativeDocumentPaneContainer, false); } else { //add new child after last (append) relativePaneContainer.InsertChildRelativeTo(paneToAnchor, relativeDocumentPaneContainer, true); } } } relativePaneContainer.InvalidateMeasure(); #endregion if (anchor == AnchorStyle.Left || anchor == AnchorStyle.Right) { double w = Math.Min( ResizingPanel.GetEffectiveSize(relativePane).Width / 2.0, ResizingPanel.GetEffectiveSize(paneToAnchor).Width); ResizingPanel.SetResizeWidth(paneToAnchor, new GridLength(w, GridUnitType.Pixel)); ResizingPanel.SetResizeHeight(paneToAnchor, new GridLength(1.0, GridUnitType.Star)); } else { double h = Math.Min( ResizingPanel.GetEffectiveSize(relativePane).Height / 2.0, ResizingPanel.GetEffectiveSize(paneToAnchor).Height); ResizingPanel.SetResizeWidth(paneToAnchor, new GridLength(1.0, GridUnitType.Star)); ResizingPanel.SetResizeHeight(paneToAnchor, new GridLength(h, GridUnitType.Pixel)); } //refresh contents state foreach (DockableContent draggedContent in paneToAnchor.Items) { draggedContent.SetStateToDock(); } //than set the new anchor style for the pane paneToAnchor.Anchor = anchor; //paneToAnchor.Focus(); }
ResizingPanel RestoreResizingPanel(XmlElement mainElement, DockableContent[] actualContents, DocumentContent[] actualDocuments, ref DocumentPane mainDocumentPane) { ResizingPanel panel = null; if (mainElement.Name == "DocumentPaneResizingPanel") panel = new DocumentPaneResizingPanel(); else panel = new ResizingPanel(); if (mainElement.HasAttribute("Orientation")) panel.Orientation = (Orientation)Enum.Parse(typeof(Orientation), mainElement.GetAttribute("Orientation")); if (mainElement.HasAttribute("ResizeWidth")) ResizingPanel.SetResizeWidth(panel, (GridLength)GLConverter.ConvertFromInvariantString(mainElement.GetAttribute("ResizeWidth"))); if (mainElement.HasAttribute("ResizeHeight")) ResizingPanel.SetResizeHeight(panel, (GridLength)GLConverter.ConvertFromInvariantString(mainElement.GetAttribute("ResizeHeight"))); if (mainElement.HasAttribute("EffectiveSize")) ResizingPanel.SetEffectiveSize(panel, (Size)(new SizeConverter()).ConvertFromInvariantString(mainElement.GetAttribute("EffectiveSize"))); foreach (XmlElement childElement in mainElement.ChildNodes) { if (childElement.Name == "ResizingPanel" || childElement.Name == "DocumentPaneResizingPanel") { var childPanel = RestoreResizingPanel(childElement, actualContents, actualDocuments, ref mainDocumentPane); if (childPanel.Children.Count > 0) { panel.Children.Add(childPanel); } else { Debug.WriteLine("Found empty ResizingPanel in stored layout, it will be discarded."); } } #region Restore DockablePane else if (childElement.Name == "DockablePane") { var pane = RestoreDockablePaneLayout(childElement, actualContents, actualDocuments); //restore dockable panes even if no contents are inside (an hidden content could refer this pane in SaveStateAndPosition) panel.Children.Add(pane); } #endregion #region Restore Contents inside a DocumentPane else if (childElement.Name == "DocumentPane") { var documentPane = RestoreDocumentPaneLayout(childElement, actualContents, actualDocuments); bool isMainDocumentPane = false; if (childElement.HasAttribute("IsMain")) isMainDocumentPane = XmlConvert.ToBoolean(childElement.GetAttribute("IsMain")); if (documentPane.Items.Count > 0 || isMainDocumentPane) panel.Children.Add(documentPane); if (isMainDocumentPane) { if (mainDocumentPane != null) throw new InvalidOperationException("Main document pane is set more than one time"); mainDocumentPane = documentPane; } } #endregion } return panel; }
///// <summary> ///// Restore from xml a document pane ///// </summary> ///// <param name="childElement"></param> ///// <param name="mainExistingDocumentPane"></param> ///// <param name="existingDocumentPanel"></param> ///// <param name="dockableContents"></param> //void RestoreDocumentPaneLayout(XmlElement childElement, out DocumentPane mainExistingDocumentPane, out DocumentPaneResizingPanel existingDocumentPanel, DockableContent[] dockableContents) //{ // mainExistingDocumentPane = (Content is DocumentPane) ? Content as DocumentPane : GetMainDocumentPane(Content as ResizingPanel); // if (mainExistingDocumentPane != null) // { // existingDocumentPanel = mainExistingDocumentPane.GetParentDocumentPaneResizingPanel(); // } // else // { // existingDocumentPanel = null; // } // if (existingDocumentPanel != null) // { // if (existingDocumentPanel.Parent is ResizingPanel) // { // ((ResizingPanel)existingDocumentPanel.Parent).RemoveChild(existingDocumentPanel); // } // else if (existingDocumentPanel.Parent is DockingManager) // { // ((DockingManager)existingDocumentPanel.Parent).Content = null; // } // } // else if (mainExistingDocumentPane != null) // { // if (mainExistingDocumentPane.Parent is ResizingPanel) // { // ((ResizingPanel)mainExistingDocumentPane.Parent).RemoveChild(mainExistingDocumentPane); // } // else if (mainExistingDocumentPane.Parent is DockingManager) // { // ((DockingManager)mainExistingDocumentPane.Parent).Content = null; // } // } // foreach (XmlElement contentElement in childElement.ChildNodes) // { // if (contentElement.HasAttribute("Name")) // { // DockableContent foundContent = null; // string contentName = contentElement.GetAttribute("Name"); // foreach (DockableContent content in dockableContents) // { // if (content.Name == contentName) // { // foundContent = content; // break; // } // } // if (foundContent == null && // DeserializationCallback != null) // { // DeserializationCallbackEventArgs e = new DeserializationCallbackEventArgs(contentName); // DeserializationCallback(this, e); // foundContent = e.Content as DockableContent; // } // if (foundContent != null) // { // DetachContentFromDockingManager(foundContent); // mainExistingDocumentPane.Items.Add(foundContent); // foundContent.SetStateToDocument(); // //call custom layout persistence method // foundContent.RestoreLayout(contentElement); // } // } // } //} DocumentPane RestoreDocumentPaneLayout(XmlElement mainElement, DockableContent[] actualContents, DocumentContent[] actualDocuments) { var documentPane = new DocumentPane(); if (mainElement.HasAttribute("ResizeWidth")) ResizingPanel.SetResizeWidth(documentPane, (GridLength)GLConverter.ConvertFromInvariantString(mainElement.GetAttribute("ResizeWidth"))); if (mainElement.HasAttribute("ResizeHeight")) ResizingPanel.SetResizeHeight(documentPane, (GridLength)GLConverter.ConvertFromInvariantString(mainElement.GetAttribute("ResizeHeight"))); if (mainElement.HasAttribute("EffectiveSize")) ResizingPanel.SetEffectiveSize(documentPane, (Size)(new SizeConverter()).ConvertFromInvariantString(mainElement.GetAttribute("EffectiveSize"))); foreach (XmlElement contentElement in mainElement.ChildNodes) { if (contentElement.Name == "DockableContent" && contentElement.HasAttribute("Name")) { DockableContent foundContent = null; string contentName = contentElement.GetAttribute("Name"); foundContent = actualContents.FirstOrDefault(c => c.Name == contentName); if (foundContent == null && DeserializationCallback != null) { DeserializationCallbackEventArgs e = new DeserializationCallbackEventArgs(contentName); DeserializationCallback(this, e); foundContent = e.Content as DockableContent; } if (foundContent != null) { DetachContentFromDockingManager(foundContent); documentPane.Items.Add(foundContent); foundContent.SetStateToDocument(); //call custom layout persistence method foundContent.RestoreLayout(contentElement); } } else if (contentElement.Name == "DocumentContent" && contentElement.HasAttribute("Name")) { DocumentContent foundDocument = null; string contentName = contentElement.GetAttribute("Name"); foundDocument = actualDocuments.FirstOrDefault(c => c.Name == contentName); if (foundDocument == null && DeserializationCallback != null) { DeserializationCallbackEventArgs e = new DeserializationCallbackEventArgs(contentName); DeserializationCallback(this, e); foundDocument = e.Content as DocumentContent; } if (foundDocument != null) { foundDocument.DetachFromContainerPane(); documentPane.Items.Add(foundDocument); } } } if (mainElement.HasAttribute("SelectedIndex")) documentPane.SelectedIndex = XmlConvert.ToInt32(mainElement.GetAttribute("SelectedIndex")); return documentPane; }
internal void EnsurePanePositionIsValid(DocumentPane pane) { if (pane == MainDocumentPane) return; //A document pane must be at maindocument pane level or deeper if (MainDocumentPane.Parent == this) { throw new InvalidOperationException("A document pane can't be positioned at this level!"); } }
public void Register( RenderWindowManager rwm ) { this.rwm = rwm; //var tabItem = new TabItem(); //tabItem.Header = "Pokus"; // var tabItems = TabControl.Items; var resHorizontalPanel = new ResizingPanel() { Orientation = Orientation.Horizontal }; var resVerticalPanel = new ResizingPanel() { Orientation = Orientation.Vertical }; /* OpenGLWindow tempGLWin = rwm.RenderWindows[0].GlWindows[0]; var wfh = new WindowsFormsHost(); wfh.Child = tempGLWin; var dockPane = new DockablePane(); var documentPane = new DocumentPane(); dockPane.Items.Add( new DockableContent() { Name = "classesContent", Title = "Classes" } ); */ var dockPane = new DockablePane(); var documentPane = new DocumentPane(); foreach ( var openglWindow in rwm.RenderWindows ) { var formHost = new WindowsFormsHost() { Child = openglWindow.GlWindows[0] }; documentPane.Items.Add ( new DocumentContent() { Content = formHost, Title = "a" } ); } //var a = new DocumentContent(); //a.Content = wfh; //a.Title = "Raycast"; //documentPane.Items.Add( a ); //documentPane.Items.Add( new DocumentContent() //{ // Title = "My Document!" //} ); //dockPane.Items.Add( new DockableContent() //{ // Name = "classesContent", // Title = "Logs", //} ); //var logDockPane = new DockablePane(); //logDockPane.Items.Add( new DockableContent() //{ // Name = "classesContent", // Title = "Logs", //} //); //resVerticalPanel.Children.Add( logDockPane ); ResizingPanel XXX = DockingManager.Content as ResizingPanel; XXX.Children.Add( dockPane ); XXX.Children.Add( documentPane ); //resHorizontalPanel.Children.Add( logDockPane); DockingManager.Content = XXX; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 8 "..\..\Window4.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnAddDocuments_Click); #line default #line hidden return; case 2: #line 9 "..\..\Window4.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnRemoveCurrent_Click); #line default #line hidden return; case 3: #line 10 "..\..\Window4.xaml" ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnRemoveAll_Click); #line default #line hidden return; case 4: this.dockingManager = ((AvalonDock.DockingManager)(target)); #line 12 "..\..\Window4.xaml" this.dockingManager.Loaded += new System.Windows.RoutedEventHandler(this.dockingManager_Loaded); #line default #line hidden #line 12 "..\..\Window4.xaml" this.dockingManager.RequestDocumentClose += new System.EventHandler<AvalonDock.RequestDocumentCloseEventArgs>(this.dockingManager_RequestDocumentClose); #line default #line hidden return; case 5: this._documentHost = ((AvalonDock.DocumentPane)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 22 "..\..\MainWindow.xaml" ((Novartis.Msi.MSImageView.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.WindowClosing); #line default #line hidden #line 22 "..\..\MainWindow.xaml" ((Novartis.Msi.MSImageView.MainWindow)(target)).Closed += new System.EventHandler(this.WindowClosed); #line default #line hidden #line 22 "..\..\MainWindow.xaml" ((Novartis.Msi.MSImageView.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.WindowLoaded); #line default #line hidden #line 22 "..\..\MainWindow.xaml" ((Novartis.Msi.MSImageView.MainWindow)(target)).Initialized += new System.EventHandler(this.WindowInitialized); #line default #line hidden return; case 2: #line 26 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.OnCmdOpen); #line default #line hidden return; case 3: #line 27 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.OnCmdSaveAs); #line default #line hidden #line 27 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).CanExecute += new System.Windows.Input.CanExecuteRoutedEventHandler(this.CanExecuteCmdSaveAs); #line default #line hidden return; case 4: #line 28 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.OnCmdExit); #line default #line hidden return; case 5: #line 29 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.OnCmdAbout); #line default #line hidden return; case 6: #line 30 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.OnCmdToggleToolTips); #line default #line hidden return; case 7: #line 31 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.OnCmdUseApproximation); #line default #line hidden return; case 8: #line 32 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.OnCmdNewRoi); #line default #line hidden return; case 9: #line 33 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.OnCmdOpenRoi); #line default #line hidden return; case 10: #line 34 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.OnCmdSaveRoi); #line default #line hidden return; case 11: #line 35 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.OnCmdSaveRoiAs); #line default #line hidden return; case 12: #line 36 "..\..\MainWindow.xaml" ((System.Windows.Input.CommandBinding)(target)).Executed += new System.Windows.Input.ExecutedRoutedEventHandler(this.OnCmdCloseRoi); #line default #line hidden return; case 13: this.LayoutRoot = ((System.Windows.Controls.Grid)(target)); return; case 14: this.FileMenu = ((System.Windows.Controls.MenuItem)(target)); return; case 15: this.FileOpen = ((System.Windows.Controls.MenuItem)(target)); return; case 16: this.FileSaveAs = ((System.Windows.Controls.MenuItem)(target)); return; case 17: this.FileExit = ((System.Windows.Controls.MenuItem)(target)); return; case 18: this.ROIMenu = ((System.Windows.Controls.MenuItem)(target)); return; case 19: this.RoiNew = ((System.Windows.Controls.MenuItem)(target)); return; case 20: this.RoiOpen = ((System.Windows.Controls.MenuItem)(target)); return; case 21: this.RoiSave = ((System.Windows.Controls.MenuItem)(target)); return; case 22: this.RoiSaveAs = ((System.Windows.Controls.MenuItem)(target)); return; case 23: this.RoiClose = ((System.Windows.Controls.MenuItem)(target)); return; case 24: this.ViewMenu = ((System.Windows.Controls.MenuItem)(target)); return; case 25: this.ShowToolTips = ((System.Windows.Controls.MenuItem)(target)); return; case 26: this.ShowStatusBar = ((System.Windows.Controls.MenuItem)(target)); #line 77 "..\..\MainWindow.xaml" this.ShowStatusBar.Click += new System.Windows.RoutedEventHandler(this.ShowStatusBarClick); #line default #line hidden return; case 27: this.ViewIntensityGraph = ((System.Windows.Controls.MenuItem)(target)); #line 78 "..\..\MainWindow.xaml" this.ViewIntensityGraph.Click += new System.Windows.RoutedEventHandler(this.ViewIntensityGraphClick); #line default #line hidden return; case 28: this.SettingsMenu = ((System.Windows.Controls.MenuItem)(target)); return; case 29: this.UseApproximation = ((System.Windows.Controls.MenuItem)(target)); return; case 30: this.HelpMenu = ((System.Windows.Controls.MenuItem)(target)); return; case 31: this.HelpAbout = ((System.Windows.Controls.MenuItem)(target)); return; case 32: this.toolBarTray = ((System.Windows.Controls.ToolBarTray)(target)); return; case 33: this.tbFile = ((System.Windows.Controls.ToolBar)(target)); return; case 34: this.tbbOpen = ((System.Windows.Controls.Button)(target)); #line 92 "..\..\MainWindow.xaml" this.tbbOpen.Click += new System.Windows.RoutedEventHandler(this.OnCmdOpen); #line default #line hidden return; case 35: this.tbbSaveAs = ((System.Windows.Controls.Button)(target)); #line 95 "..\..\MainWindow.xaml" this.tbbSaveAs.Click += new System.Windows.RoutedEventHandler(this.OnCmdSaveAs); #line default #line hidden return; case 36: this.dockingManager = ((AvalonDock.DockingManager)(target)); #line 102 "..\..\MainWindow.xaml" this.dockingManager.ActiveContentChanged += new System.EventHandler(this.DockingManagerActiveContentChanged); #line default #line hidden #line 102 "..\..\MainWindow.xaml" this.dockingManager.ActiveDocumentChanged += new System.EventHandler(this.DockingManagerActiveDocumentChanged); #line default #line hidden #line 102 "..\..\MainWindow.xaml" this.dockingManager.DocumentClosed += new System.EventHandler(this.DockingManagerDocumentClosed); #line default #line hidden #line 102 "..\..\MainWindow.xaml" this.dockingManager.DocumentClosing += new System.EventHandler <System.ComponentModel.CancelEventArgs>(this.DockingManagerDocumentClosing); #line default #line hidden return; case 37: this.resizingPane = ((AvalonDock.ResizingPanel)(target)); return; case 38: this.documentPane = ((AvalonDock.DocumentPane)(target)); return; case 39: this.dockablePane = ((AvalonDock.DockablePane)(target)); return; case 40: this.imagePropsContent = ((Novartis.Msi.MSImageView.ImagePropsContent)(target)); return; case 41: this.roiProjectWindow = ((Novartis.Msi.MSImageView.RoiProjectWindow)(target)); return; case 42: this.metaContent = ((Novartis.Msi.MSImageView.MetaContent)(target)); return; case 43: this.statusBar = ((System.Windows.Controls.Primitives.StatusBar)(target)); return; case 44: this.coordinatesLabel = ((System.Windows.Controls.TextBlock)(target)); return; case 45: this.coordinates = ((System.Windows.Controls.TextBlock)(target)); return; case 46: this.intensityLabel = ((System.Windows.Controls.TextBlock)(target)); return; case 47: this.intensity = ((System.Windows.Controls.TextBlock)(target)); return; case 48: this.infoText = ((System.Windows.Controls.TextBlock)(target)); return; case 49: this.progressOperation = ((System.Windows.Controls.TextBlock)(target)); return; case 50: this.progressBar = ((System.Windows.Controls.ProgressBar)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 6 "..\..\Demo.xaml" ((AvalonDockTest.Demo)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing); #line default #line hidden #line 6 "..\..\Demo.xaml" ((AvalonDockTest.Demo)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded); #line default #line hidden return; case 2: this.ShowDockingManager = ((System.Windows.Controls.MenuItem)(target)); #line 90 "..\..\Demo.xaml" this.ShowDockingManager.Click += new System.Windows.RoutedEventHandler(this.ShowDockingManager_Checked); #line default #line hidden return; case 3: #line 91 "..\..\Demo.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor_Clicked); #line default #line hidden return; case 4: #line 92 "..\..\Demo.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor_Clicked); #line default #line hidden return; case 5: #line 93 "..\..\Demo.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor_Clicked); #line default #line hidden return; case 6: #line 94 "..\..\Demo.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor_Clicked); #line default #line hidden return; case 7: #line 95 "..\..\Demo.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor_Clicked); #line default #line hidden return; case 8: #line 96 "..\..\Demo.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor_Clicked); #line default #line hidden return; case 9: #line 97 "..\..\Demo.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor_Clicked); #line default #line hidden return; case 10: #line 99 "..\..\Demo.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ResetColors_Clicked); #line default #line hidden return; case 11: this.TestContainer = ((System.Windows.Controls.ContentControl)(target)); return; case 12: this._dockingManager = ((AvalonDock.DockingManager)(target)); return; case 13: this._propertiesWindow = ((AvalonDock.DockableContent)(target)); return; case 14: this._documentsHost = ((AvalonDock.DocumentPane)(target)); return; case 15: this.docHome = ((AvalonDock.DocumentContent)(target)); #line 124 "..\..\Demo.xaml" this.docHome.Closing += new System.EventHandler<System.ComponentModel.CancelEventArgs>(this.doc_Closing); #line default #line hidden return; case 16: this.NewDocuments = ((System.Windows.Documents.Hyperlink)(target)); #line 194 "..\..\Demo.xaml" this.NewDocuments.Click += new System.Windows.RoutedEventHandler(this.NewDocuments_Click); #line default #line hidden return; case 17: this.ShowProperties = ((System.Windows.Documents.Hyperlink)(target)); #line 196 "..\..\Demo.xaml" this.ShowProperties.Click += new System.Windows.RoutedEventHandler(this.ShowProperties_Click); #line default #line hidden return; case 18: this.ShowProperties_AutoHide = ((System.Windows.Documents.Hyperlink)(target)); #line 197 "..\..\Demo.xaml" this.ShowProperties_AutoHide.Click += new System.Windows.RoutedEventHandler(this.ShowProperties_Click); #line default #line hidden return; case 19: this.ShowProperties_FloatingWindow = ((System.Windows.Documents.Hyperlink)(target)); #line 198 "..\..\Demo.xaml" this.ShowProperties_FloatingWindow.Click += new System.Windows.RoutedEventHandler(this.ShowProperties_Click); #line default #line hidden return; case 20: this.ShowExplorer = ((System.Windows.Documents.Hyperlink)(target)); #line 200 "..\..\Demo.xaml" this.ShowExplorer.Click += new System.Windows.RoutedEventHandler(this.ShowExplorer_Click); #line default #line hidden return; case 21: this.ShowExplorer_AutoHide = ((System.Windows.Documents.Hyperlink)(target)); #line 201 "..\..\Demo.xaml" this.ShowExplorer_AutoHide.Click += new System.Windows.RoutedEventHandler(this.ShowExplorer_Click); #line default #line hidden return; case 22: this.ShowExplorer_FloatingWindow = ((System.Windows.Documents.Hyperlink)(target)); #line 202 "..\..\Demo.xaml" this.ShowExplorer_FloatingWindow.Click += new System.Windows.RoutedEventHandler(this.ShowExplorer_Click); #line default #line hidden return; case 23: this.ShowEventsLog = ((System.Windows.Documents.Hyperlink)(target)); #line 204 "..\..\Demo.xaml" this.ShowEventsLog.Click += new System.Windows.RoutedEventHandler(this.ShowEventsLog_Click); #line default #line hidden return; case 24: this.ShowEventsLog_AutoHide = ((System.Windows.Documents.Hyperlink)(target)); #line 205 "..\..\Demo.xaml" this.ShowEventsLog_AutoHide.Click += new System.Windows.RoutedEventHandler(this.ShowEventsLog_Click); #line default #line hidden return; case 25: this.ShowEventsLog_FloatingWindow = ((System.Windows.Documents.Hyperlink)(target)); #line 206 "..\..\Demo.xaml" this.ShowEventsLog_FloatingWindow.Click += new System.Windows.RoutedEventHandler(this.ShowEventsLog_Click); #line default #line hidden return; case 26: this.ShowEventsLog_DockRight = ((System.Windows.Documents.Hyperlink)(target)); #line 207 "..\..\Demo.xaml" this.ShowEventsLog_DockRight.Click += new System.Windows.RoutedEventHandler(this.ShowEventsLog_Click); #line default #line hidden return; case 27: this.ShowProperty = ((System.Windows.Documents.Hyperlink)(target)); #line 209 "..\..\Demo.xaml" this.ShowProperty.Click += new System.Windows.RoutedEventHandler(this.ShowProperty_Click); #line default #line hidden return; case 28: this.ShowProperty_AutoHide = ((System.Windows.Documents.Hyperlink)(target)); #line 210 "..\..\Demo.xaml" this.ShowProperty_AutoHide.Click += new System.Windows.RoutedEventHandler(this.ShowProperty_Click); #line default #line hidden return; case 29: this.ShowProperty_FloatingWindow = ((System.Windows.Documents.Hyperlink)(target)); #line 211 "..\..\Demo.xaml" this.ShowProperty_FloatingWindow.Click += new System.Windows.RoutedEventHandler(this.ShowProperty_Click); #line default #line hidden return; case 30: this.ShowProperty_DockRight = ((System.Windows.Documents.Hyperlink)(target)); #line 212 "..\..\Demo.xaml" this.ShowProperty_DockRight.Click += new System.Windows.RoutedEventHandler(this.ShowProperty_Click); #line default #line hidden return; case 31: this.SaveLayout = ((System.Windows.Documents.Hyperlink)(target)); #line 214 "..\..\Demo.xaml" this.SaveLayout.Click += new System.Windows.RoutedEventHandler(this.SaveLayout_Click); #line default #line hidden return; case 32: this.RestoreLayout = ((System.Windows.Documents.Hyperlink)(target)); #line 215 "..\..\Demo.xaml" this.RestoreLayout.Click += new System.Windows.RoutedEventHandler(this.RestoreLayout_Click); #line default #line hidden return; case 33: this._objectExplorerHost = ((AvalonDock.DockableContent)(target)); return; case 34: this._errorList = ((AvalonDockTest.ErrorListContent)(target)); return; case 35: this._eventsLogWindow = ((AvalonDock.DockableContent)(target)); return; case 36: this._txtLog = ((System.Windows.Controls.TextBox)(target)); return; case 37: this._explorerWindow = ((AvalonDock.DockableContent)(target)); return; case 38: this.tabControl = ((System.Windows.Controls.TabControl)(target)); return; case 39: this.ButtonDefault = ((System.Windows.Controls.Button)(target)); #line 271 "..\..\Demo.xaml" this.ButtonDefault.Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; case 40: this.ButtonDefault2 = ((System.Windows.Controls.Button)(target)); #line 275 "..\..\Demo.xaml" this.ButtonDefault2.Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; case 41: this.ButtonDefault3 = ((System.Windows.Controls.Button)(target)); #line 276 "..\..\Demo.xaml" this.ButtonDefault3.Click += new System.Windows.RoutedEventHandler(this.Button_Click); #line default #line hidden return; } this._contentLoaded = true; }
public override Pane ClonePane() { DocumentPane paneToAnchor = new DocumentPane(); ////transfer the resizing panel sizes //paneToAnchor.SetValue(ResizingPanel.ResizeWidthProperty, // HostedPane.GetValue(ResizingPanel.ResizeWidthProperty)); //paneToAnchor.SetValue(ResizingPanel.ResizeHeightProperty, // HostedPane.GetValue(ResizingPanel.ResizeHeightProperty)); ResizingPanel.SetEffectiveSize(paneToAnchor, new Size(Width, Height)); //transfer contents from hosted pane in the floating window and //the new created dockable pane while (HostedPane.Items.Count > 0) { paneToAnchor.Items.Add( HostedPane.RemoveContent(0)); } return paneToAnchor; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 12 "..\..\..\MainWindow.xaml" ((AvalonDock.DemoApp.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded); #line default #line hidden #line 12 "..\..\..\MainWindow.xaml" ((AvalonDock.DemoApp.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing); #line default #line hidden return; case 2: #line 24 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.OnShowDockableContent); #line default #line hidden return; case 3: #line 32 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.OnCreateNewDockableContent); #line default #line hidden return; case 4: #line 33 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.OnCreateNewDockableContent); #line default #line hidden return; case 5: #line 38 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.OnShowDocumentContent); #line default #line hidden return; case 6: #line 46 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.OnCreateNewDocumentContent); #line default #line hidden return; case 7: #line 50 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.SaveToLayoutFile); #line default #line hidden return; case 8: #line 51 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.SaveToLayoutFile); #line default #line hidden return; case 9: #line 52 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.SaveToLayoutFile); #line default #line hidden return; case 10: #line 53 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.SaveToLayoutFile); #line default #line hidden return; case 11: #line 56 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.RestoreFromLayoutFile); #line default #line hidden return; case 12: #line 57 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.RestoreFromLayoutFile); #line default #line hidden return; case 13: #line 58 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.RestoreFromLayoutFile); #line default #line hidden return; case 14: #line 59 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.RestoreFromLayoutFile); #line default #line hidden return; case 15: #line 61 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ExportLayoutToDocument); #line default #line hidden return; case 16: #line 62 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ImportLayoutFromDocument); #line default #line hidden return; case 17: #line 63 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ResetContent); #line default #line hidden return; case 18: #line 66 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeStandardTheme); #line default #line hidden return; case 19: #line 67 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeStandardTheme); #line default #line hidden return; case 20: #line 68 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeStandardTheme); #line default #line hidden return; case 21: #line 69 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeStandardTheme); #line default #line hidden return; case 22: #line 71 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeCustomTheme); #line default #line hidden return; case 23: #line 72 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeCustomTheme); #line default #line hidden return; case 24: #line 75 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.SetDefaultTheme); #line default #line hidden return; case 25: #line 78 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor); #line default #line hidden return; case 26: #line 79 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor); #line default #line hidden return; case 27: #line 80 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor); #line default #line hidden return; case 28: #line 81 "..\..\..\MainWindow.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeColor); #line default #line hidden return; case 29: this.DockManager = ((AvalonDock.DockingManager)(target)); #line 87 "..\..\..\MainWindow.xaml" this.DockManager.Loaded += new System.Windows.RoutedEventHandler(this.DockManager_Loaded); #line default #line hidden #line 88 "..\..\..\MainWindow.xaml" this.DockManager.DocumentClosing += new System.EventHandler <System.ComponentModel.CancelEventArgs>(this.DockManager_DocumentClosing); #line default #line hidden return; case 30: this.Content1 = ((AvalonDock.DemoApp.SampleDockableContent)(target)); return; case 31: this.Content2 = ((AvalonDock.DemoApp.SampleDockableContent)(target)); return; case 32: this.Content3 = ((AvalonDock.DemoApp.SampleDockableContent)(target)); return; case 33: this.Content4 = ((AvalonDock.DemoApp.SampleDockableContent)(target)); return; case 34: this.DockingManagerPropertiesHost = ((AvalonDock.DockableContent)(target)); return; case 35: this.NestedDockingManager = ((AvalonDock.DockableContent)(target)); return; case 36: this.InnerContent1 = ((AvalonDock.DemoApp.SampleDockableContent)(target)); return; case 37: this.InnerDoc1 = ((AvalonDock.DocumentContent)(target)); return; case 38: this.DocumentHost = ((AvalonDock.DocumentPane)(target)); return; case 39: this.Doc1 = ((AvalonDock.DocumentContent)(target)); return; case 40: this.Doc2 = ((AvalonDock.DocumentContent)(target)); return; case 41: this.Doc3 = ((AvalonDock.DocumentContent)(target)); return; case 42: this.Doc4 = ((AvalonDock.DocumentContent)(target)); return; case 43: this.zoomSlider = ((System.Windows.Controls.Slider)(target)); return; } this._contentLoaded = true; }
internal void DropInto(DocumentPane paneDragged, DocumentPane paneToDropInto) { //transfer tha contents of dragged pane (conatined in a FloatingWindow) //to the pane which user select //ManagedContent contentToFocus = null; while (paneDragged.Items.Count > 0) { var contentToTransfer = paneDragged.RemoveContent(0); paneToDropInto.Items.Insert(0, contentToTransfer); //contentToFocus = contentToTransfer; contentToTransfer.Activate(); } //paneToDropInto.SelectedIndex = 0; //paneToDropInto.Focus(); //if (contentToFocus != null) // contentToFocus.Activate(); }
private void SetVisibilityOfMenuItems(DocumentPane dp) { if (dp.Visibility == Visibility.Visible) // the value is set in ConvertBack of AvalonDockVisibilityConverter!!! { dp.Visibility = System.Windows.Visibility.Visible; } else { dp.Visibility = System.Windows.Visibility.Hidden; } foreach (DocumentContent dc in dockingManager.Documents) { if (dp.Visibility == Visibility.Visible) { dc.Show(); } else { dc.Hide(); } } }
internal void DropInto(DockablePane paneDragged, DocumentPane paneToDropInto) { //if (paneToDropInto != MainDocumentPane) // paneToDropInto = MainDocumentPane; //transfer contents of dragged pane (contained in a FloatingWindow) //to the pane which user select, taking care of setting contents state //to Dock (using Dock() method of class DockablePane). while (paneDragged.Items.Count > 0) { var contentToTransfer = paneDragged.RemoveContent(0); paneToDropInto.Items.Add(contentToTransfer); var dockContentToTransfer = contentToTransfer as DockableContent; if (dockContentToTransfer != null) dockContentToTransfer.SetStateToDocument(); contentToTransfer.Activate(); } //paneToDropInto.SelectedIndex = paneToDropInto.Items.Count - 1; //paneToDropInto.Focus(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.ribbonTab1 = ((Microsoft.Windows.Controls.Ribbon.RibbonTab)(target)); return; case 2: this.ribbonGroup1 = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target)); return; case 3: this.ribbonButton1 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 4: this.ribbonButton2 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 5: this.ribbonButton3 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 6: this.ribbonGroup2 = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target)); return; case 7: this.ribbonButton4 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 8: this.ribbonButton5 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 9: this.ribbonTab2 = ((Microsoft.Windows.Controls.Ribbon.RibbonTab)(target)); return; case 10: this.ribbonGroup4 = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target)); return; case 11: this.ribbonButton8 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 12: this.ribbonButton9 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 13: this.ribbonButton10 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 14: this.ribbonGroup5 = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target)); return; case 15: this.ribbonButton11 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 16: this.ribbonButton12 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 17: this.ribbonGroup6 = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target)); return; case 18: this.ribbonButton13 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 19: this.ribbonButton14 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 20: this.ribbonTab3 = ((Microsoft.Windows.Controls.Ribbon.RibbonTab)(target)); return; case 21: this.ribbonGroup8 = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target)); return; case 22: this.ribbonButton18 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 23: this.ribbonButton19 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 24: this.ribbonButton20 = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target)); return; case 25: this.bar = ((Odyssey.Controls.OutlookBar)(target)); return; case 26: this.EmployeesContent = ((System.Windows.Controls.ContentControl)(target)); return; case 27: this.CustomersContent = ((System.Windows.Controls.ContentControl)(target)); return; case 28: this.ProductsContent = ((System.Windows.Controls.ContentControl)(target)); return; case 29: this.DocumentsRegion = ((AvalonDock.DocumentPane)(target)); return; } this._contentLoaded = true; }
/// <summary> /// This method ensure that content of this <see cref="DockingManager"/> is not empty /// </summary> void EnsureContentNotEmpty() { if (RestoringLayout) return; if (Content == null) { Content = new DocumentPane(); RefreshContents(); } }
public DocumentPane CreateNewVerticalTabGroup() { var activeContent = SelectedItem as ManagedContent; var oldContainerPane = activeContent.ContainerPane as DocumentPane; var newContainerPane = new DocumentPane(); oldContainerPane.RemoveContent(activeContent); newContainerPane.Items.Add(activeContent); GetManager().Anchor(newContainerPane, this, AnchorStyle.Right); activeContent.Activate(); newContainerPane.RefreshContainsActiveContentProperty(); newContainerPane.RefreshContainsActiveDocumentProperty(); oldContainerPane.RefreshContainsActiveContentProperty(); oldContainerPane.RefreshContainsActiveDocumentProperty(); return newContainerPane; }
/// <summary> /// Restore from xml a resizing panel or a documentpane /// </summary> /// <param name="mainElement"></param> /// <param name="actualContents"></param> /// <returns></returns> object RestoreLayout(XmlElement mainElement, DockableContent[] actualContents, DocumentContent[] actualDocuments, ref DocumentPane mainDocumentPane) { if (mainElement == null) throw new ArgumentNullException("mainElement"); if (mainElement.Name == "ResizingPanel" || mainElement.Name == "DocumentPaneResizingPanel") { return RestoreResizingPanel(mainElement, actualContents, actualDocuments, ref mainDocumentPane); } else if (mainElement.Name == "DocumentPane") { mainDocumentPane = RestoreDocumentPaneLayout(mainElement, actualContents, actualDocuments); return mainDocumentPane; } throw new InvalidOperationException(string.Format("Unable to deserialize '{0}' element", mainElement.Name)); }
internal void RefreshContents() { if (!_allowRefreshContents) return; var contentsFoundUnderMe = new LogicalTreeAdapter(this).Descendants<DependencyObject>().Where(d => d.Item is ManagedContent).Select(d => d.Item).Cast<ManagedContent>(); var contentsFoundInFloatingMode = _floatingWindows.SelectMany(d => d.HostedPane.Items.Cast<ManagedContent>()); DockableContent contentFoundInFlyoutMode = null; if (_flyoutWindow != null && _flyoutWindow.ReferencedPane != null && _flyoutWindow.ReferencedPane.Items.Count > 0) { contentFoundInFlyoutMode = _flyoutWindow.ReferencedPane.Items[0] as DockableContent; } var contentsFound = new List<ManagedContent>(); contentsFound.AddRange(contentsFoundUnderMe); contentsFound.AddRange(contentsFoundInFloatingMode); if (contentFoundInFlyoutMode != null) contentsFound.Add(contentFoundInFlyoutMode); var dockableContensToRemove = DockableContents.Except(contentsFound.OfType<DockableContent>()); var dockableContensToAdd = contentsFound.OfType<DockableContent>().Except(DockableContents); dockableContensToAdd.ToArray().ForEach(d => { if (d.State != DockableContentState.Hidden) DockableContents.Add(d); }); dockableContensToRemove.ToArray().ForEach(d => { if (d.State != DockableContentState.Hidden) DockableContents.Remove(d); }); var documentsToRemove = Documents.Except(contentsFound.OfType<DocumentContent>()); var documentsToAdd = contentsFound.OfType<DocumentContent>().Except(Documents); documentsToAdd.ToArray().ForEach(d => Documents.Add(d)); documentsToRemove.ToArray().ForEach(d => Documents.Remove(d)); //refresh MainDocumentPane if (MainDocumentPane == null || MainDocumentPane.GetManager() != this) { ILinqToTree<DependencyObject> itemFound = new LogicalTreeAdapter(this).Descendants<DependencyObject>().FirstOrDefault(d => d.Item is DocumentPane); MainDocumentPane = itemFound != null ? itemFound.Item as DocumentPane : null; } //_floatingWindows.ForEach(fl => fl.CheckContents()); CheckValidPanesFromTabGroups(); }
void SaveLayout(XmlWriter xmlWriter, DocumentPane pane) { if (pane.Items.Count == 0 && !pane.IsMainDocumentPane.GetValueOrDefault()) return; xmlWriter.WriteStartElement("DocumentPane"); if (pane.IsMainDocumentPane.GetValueOrDefault()) xmlWriter.WriteAttributeString("IsMain", "true"); if (pane.Items.Count > 1) xmlWriter.WriteAttributeString("SelectedIndex", XmlConvert.ToString(pane.SelectedIndex)); xmlWriter.WriteAttributeString("ResizeWidth", ResizingPanel.GetResizeWidth(pane).ToString()); xmlWriter.WriteAttributeString("ResizeHeight", ResizingPanel.GetResizeHeight(pane).ToString()); xmlWriter.WriteAttributeString("EffectiveSize", new SizeConverter().ConvertToInvariantString(ResizingPanel.GetEffectiveSize(pane))); foreach (ManagedContent content in pane.Items) { if (content is DockableContent) { var dockableContent = content as DockableContent; SaveLayout(xmlWriter, dockableContent); } else if (content is DocumentContent) { var documentContent = content as DocumentContent; SaveLayout(xmlWriter, documentContent); } } xmlWriter.WriteEndElement(); }
void NewVerticalTabGroup() { ManagedContent activeContent = SelectedItem as ManagedContent; DocumentPane newContainerPane = new DocumentPane(); int indexOfDocumentInItsContainer = activeContent.ContainerPane.Items.IndexOf(activeContent); activeContent.ContainerPane.RemoveContent(indexOfDocumentInItsContainer); newContainerPane.Items.Add(activeContent); GetManager().Anchor(newContainerPane, this, AnchorStyle.Right); }
/// <summary> /// Anchor a document pane (<see cref="DocumentPane"/>) to a border of an other document pane /// </summary> /// <param name="paneToAnchor">Pane to anchor</param> /// <param name="relativePane">Pane relative</param> /// <param name="anchor"></param> public void Anchor(DocumentPane paneToAnchor, DocumentPane relativePane, AnchorStyle anchor) { //ensure that content property is not empty EnsureContentNotEmpty(); if (anchor == AnchorStyle.None) anchor = AnchorStyle.Right; //get a reference to the resizingpanel container of relativePane ResizingPanel relativePaneContainer = LogicalTreeHelper.GetParent(relativePane) as ResizingPanel; DocumentPaneResizingPanel relativeDocumentPaneContainer = relativePane.GetParentDocumentPaneResizingPanel(); Orientation requestedOrientation = (anchor == AnchorStyle.Bottom || anchor == AnchorStyle.Top) ? Orientation.Vertical : Orientation.Horizontal; if (relativePaneContainer == null) { Debug.Assert(relativePane.Parent == this); relativeDocumentPaneContainer = new DocumentPaneResizingPanel(); relativePaneContainer = relativeDocumentPaneContainer; relativeDocumentPaneContainer.Orientation = requestedOrientation; this.Content = relativePaneContainer; relativePaneContainer.Children.Add(relativePane); } if (relativeDocumentPaneContainer == null) { relativeDocumentPaneContainer = new DocumentPaneResizingPanel(); relativeDocumentPaneContainer.Orientation = requestedOrientation; int indexOfPaneToReplace = relativePaneContainer.Children.IndexOf(relativePane); relativePaneContainer.Children.RemoveAt(indexOfPaneToReplace); relativeDocumentPaneContainer.Children.Add(relativePane); relativePaneContainer.Children.Insert(indexOfPaneToReplace, relativeDocumentPaneContainer); relativePaneContainer = relativeDocumentPaneContainer; } Debug.Assert(relativePaneContainer != null, "By now we can't have a pane without a resizing panel containing it"); #region Create and setup container panel if (relativePaneContainer != null) { //check if orientation is right if (relativePaneContainer.Orientation != requestedOrientation) { //if the existing panel is not oriented as we want //create a new one DocumentPaneResizingPanel newPanel = new DocumentPaneResizingPanel(); newPanel.Orientation = requestedOrientation; //replace relative pane in its' container panel //with this new panel int indexofRelativePane = relativePaneContainer.Children.IndexOf(relativePane); relativePaneContainer.Children.Remove(relativePane); relativePaneContainer.Children.Insert(indexofRelativePane, newPanel); //now we have a panel correctly placed in the tree newPanel.Children.Add(relativePane); //use InsertChildRelativeTo function to add a resizingsplitter between //the two children newPanel.InsertChildRelativeTo( paneToAnchor, relativePane, anchor == AnchorStyle.Right || anchor == AnchorStyle.Bottom); relativePaneContainer = newPanel; } else { if (anchor == AnchorStyle.Left || anchor == AnchorStyle.Top) { //add new child before first (prepend) relativePaneContainer.InsertChildRelativeTo(paneToAnchor, relativePane, false); } else { //add new child after last (append) relativePaneContainer.InsertChildRelativeTo(paneToAnchor, relativePane, true); } //if (relativePaneContainer.Orientation == Orientation.Horizontal) //{ // Size desideredSize = ResizingPanel.GetEffectiveSize(paneToAnchor); // double approxStarForNewPane = desideredSize.Width / relativePaneContainer.ActualWidth; // approxStarForNewPane = Math.Min(approxStarForNewPane, 1.0); // paneToAnchor.SetValue(ResizingPanel.ResizeWidthProperty, new GridLength(approxStarForNewPane, GridUnitType.Star)); //} } relativePaneContainer.InvalidateMeasure(); } #endregion //paneToAnchor.Focus(); //(paneToAnchor.SelectedItem as ManagedContent).Activate(); //if (paneToAnchor.SelectedItem is DocumentContent) // ActiveDocument = paneToAnchor.SelectedItem as DocumentContent; paneToAnchor.SelectedIndex = 0; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: #line 67 "..\..\..\winMain.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.btnNewDoc_Click); #line default #line hidden return; case 2: #line 68 "..\..\..\winMain.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.btnOpenDoc_Click); #line default #line hidden return; case 3: #line 70 "..\..\..\winMain.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.btnSaveDoc_Click); #line default #line hidden return; case 4: #line 73 "..\..\..\winMain.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.btnProjOpen_Click); #line default #line hidden return; case 5: #line 75 "..\..\..\winMain.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.btnDocAddToProj_Click); #line default #line hidden return; case 6: #line 76 "..\..\..\winMain.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.btnDocRemoveFormProj_Click); #line default #line hidden return; case 7: #line 81 "..\..\..\winMain.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.OnShowDockableContent); #line default #line hidden return; case 8: #line 91 "..\..\..\winMain.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.OnShowDocumentContent); #line default #line hidden return; case 9: #line 98 "..\..\..\winMain.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItemCloseAllDocs_Click); #line default #line hidden return; case 10: #line 107 "..\..\..\winMain.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeStandardTheme); #line default #line hidden return; case 11: #line 108 "..\..\..\winMain.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.ChangeStandardTheme); #line default #line hidden return; case 12: #line 111 "..\..\..\winMain.xaml" ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.AboutMenu_Click); #line default #line hidden return; case 13: this.btnProjOpen = ((System.Windows.Controls.Button)(target)); #line 115 "..\..\..\winMain.xaml" this.btnProjOpen.Click += new System.Windows.RoutedEventHandler(this.btnProjOpen_Click); #line default #line hidden return; case 14: this.btnProjNew = ((System.Windows.Controls.Button)(target)); #line 120 "..\..\..\winMain.xaml" this.btnProjNew.Click += new System.Windows.RoutedEventHandler(this.btnProjNew_Click); #line default #line hidden return; case 15: this.btnOpenDoc = ((System.Windows.Controls.Button)(target)); #line 125 "..\..\..\winMain.xaml" this.btnOpenDoc.Click += new System.Windows.RoutedEventHandler(this.btnOpenDoc_Click); #line default #line hidden return; case 16: this.btnNewDoc = ((System.Windows.Controls.Button)(target)); #line 130 "..\..\..\winMain.xaml" this.btnNewDoc.Click += new System.Windows.RoutedEventHandler(this.btnNewDoc_Click); #line default #line hidden return; case 17: this.btnSaveDoc = ((System.Windows.Controls.Button)(target)); #line 135 "..\..\..\winMain.xaml" this.btnSaveDoc.Click += new System.Windows.RoutedEventHandler(this.btnSaveDoc_Click); #line default #line hidden return; case 18: this.btnDeleteDoc = ((System.Windows.Controls.Button)(target)); #line 140 "..\..\..\winMain.xaml" this.btnDeleteDoc.Click += new System.Windows.RoutedEventHandler(this.btnDeleteDoc_Click); #line default #line hidden return; case 19: this.btnGenerateCode = ((System.Windows.Controls.Button)(target)); #line 162 "..\..\..\winMain.xaml" this.btnGenerateCode.Click += new System.Windows.RoutedEventHandler(this.btnGenerateCode_Click); #line default #line hidden return; case 20: this.imgSingle = ((System.Windows.Controls.Image)(target)); return; case 21: this.btnBatchGenerateCode = ((System.Windows.Controls.Button)(target)); #line 167 "..\..\..\winMain.xaml" this.btnBatchGenerateCode.Click += new System.Windows.RoutedEventHandler(this.btnBatchGenerateCode_Click); #line default #line hidden return; case 22: this.imgBatch = ((System.Windows.Controls.Image)(target)); return; case 23: this.btnExceltoScript = ((System.Windows.Controls.Button)(target)); #line 172 "..\..\..\winMain.xaml" this.btnExceltoScript.Click += new System.Windows.RoutedEventHandler(this.btnExceltoScript_Click); #line default #line hidden return; case 24: this.imgExceltoScript = ((System.Windows.Controls.Image)(target)); return; case 25: this.btnDocAddToProj = ((System.Windows.Controls.Button)(target)); #line 178 "..\..\..\winMain.xaml" this.btnDocAddToProj.Click += new System.Windows.RoutedEventHandler(this.btnDocAddToProj_Click); #line default #line hidden return; case 26: this.btnDocRemoveFromProj = ((System.Windows.Controls.Button)(target)); #line 183 "..\..\..\winMain.xaml" this.btnDocRemoveFromProj.Click += new System.Windows.RoutedEventHandler(this.btnDocRemoveFormProj_Click); #line default #line hidden return; case 27: this.DockManager = ((AvalonDock.DockingManager)(target)); return; case 28: this.lucTemplatesExplorer = ((SmartCodeGenerator.ucTemplatesExplorer)(target)); return; case 29: this.lucServerExplorer = ((SmartCodeGenerator.ucServerExplorer)(target)); return; case 30: this.DocumentHost = ((AvalonDock.DocumentPane)(target)); #line 209 "..\..\..\winMain.xaml" this.DocumentHost.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.DocumentHost_SelectionChanged); #line default #line hidden return; case 31: this.InitNewDocument = ((SmartCodeGenerator.ucBaseDocument)(target)); return; case 32: this.lucSolutionExplorer = ((SmartCodeGenerator.ucSolutionExplorer)(target)); return; case 33: this.lucDocumentProperties = ((SmartCodeGenerator.ucParameterExplorer)(target)); return; case 34: this.zoomSlider = ((System.Windows.Controls.Slider)(target)); return; } this._contentLoaded = true; }