• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# AvalonDock.DocumentContent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AvalonDock.DocumentContent的典型用法代码示例。如果您正苦于以下问题:C# DocumentContent类的具体用法?C# DocumentContent怎么用?C# DocumentContent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DocumentContent类属于AvalonDock命名空间,在下文中一共展示了DocumentContent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DocumentFloatingWindow

        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");
            }
        }
开发者ID:mousetwentytwo,项目名称:test,代码行数:32,代码来源:DocumentFloatingWindow.cs


示例2: NewEditor

 public IEditor NewEditor()
 {
     DocumentContent document = new DocumentContent();
     Editor editor = new Editor(document);
     document.Show(manager);
     document.Activate();
     return editor;
 }
开发者ID:conradz,项目名称:Edit5,代码行数:8,代码来源:EditorProvider.cs


示例3: AddDocument

        private void AddDocument(string controller, string action)
        {
            var navHost = new NavHostControl(_navFactory);
            var doc = new DocumentContent();
            doc.Title = "Document" + Model.MyDocuments.Count;
            doc.Content = navHost;
            Model.MyDocuments.Add(doc);

            // bring the newly added document's tab into focus.
            docPane.SelectedIndex = Model.MyDocuments.Count - 1;
            navHost.Navigate(controller, action);
        }
开发者ID:chrcar01,项目名称:KillSwitchEngage,代码行数:12,代码来源:MainWindow.xaml.cs


示例4: CreateNewDocument

        private void CreateNewDocument(object sender, RoutedEventArgs e)
        {

            string baseDocTitle = "MyDocument";
            int i = 1;
            string title = baseDocTitle + i.ToString();

            while (dockManager.Documents.Any(d => d.Title == title))
            {
                i++;
                title = baseDocTitle + i.ToString();
            }

            DocumentContent doc = new DocumentContent() { Title = title };
            doc.Show(dockManager);

            //MyDocuments.Add(new DocumentContent() { Title = title });
        }
开发者ID:Reticulatas,项目名称:AvalonDock,代码行数:18,代码来源:MainWindow.xaml.cs


示例5: switch


//.........这里部分代码省略.........
     this.DrawPolygonBtn.Checked += new System.Windows.RoutedEventHandler(this.DrawPolygonBtn_Checked);
     
     #line default
     #line hidden
     
     #line 60 "..\..\..\MainWindow.xaml"
     this.DrawPolygonBtn.Unchecked += new System.Windows.RoutedEventHandler(this.DrawPolygonBtn_Unchecked);
     
     #line default
     #line hidden
     return;
     case 32:
     this.RibbonDlgMgrGrp = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target));
     return;
     case 33:
     this.ToggleDlgBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 66 "..\..\..\MainWindow.xaml"
     this.ToggleDlgBtn.Click += new System.Windows.RoutedEventHandler(this.ToggleDlgBtn_Click);
     
     #line default
     #line hidden
     return;
     case 34:
     this.RibbonSpeechRecGrp = ((Microsoft.Windows.Controls.Ribbon.RibbonGroup)(target));
     return;
     case 35:
     this.ToggleSpeechBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 69 "..\..\..\MainWindow.xaml"
     this.ToggleSpeechBtn.Click += new System.Windows.RoutedEventHandler(this.ToggleSpeechBtn_Click);
     
     #line default
     #line hidden
     return;
     case 36:
     this.SimSpeechBtn = ((Microsoft.Windows.Controls.Ribbon.RibbonButton)(target));
     
     #line 70 "..\..\..\MainWindow.xaml"
     this.SimSpeechBtn.Click += new System.Windows.RoutedEventHandler(this.SimSpeechBtn_Click);
     
     #line default
     #line hidden
     return;
     case 37:
     this.dockManager = ((AvalonDock.DockingManager)(target));
     return;
     case 38:
     this.LayersPanel = ((AvalonDock.DockableContent)(target));
     return;
     case 39:
     this.tocGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 40:
     
     #line 84 "..\..\..\MainWindow.xaml"
     ((AvalonDock.DocumentPane)(target)).SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.DocumentPane_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 41:
     this.MapPanel = ((AvalonDock.DocumentContent)(target));
     return;
     case 42:
     this.mapGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 43:
     this.LayoutPanel = ((AvalonDock.DocumentContent)(target));
     return;
     case 44:
     this.layoutGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 45:
     this.KinectCtrlPanel = ((AvalonDock.DockablePane)(target));
     return;
     case 46:
     this.ColorDisplayPanel = ((AvalonDock.DockableContent)(target));
     return;
     case 47:
     this.colorDisplay = ((System.Windows.Controls.Image)(target));
     return;
     case 48:
     this.skeletonCanvas = ((System.Windows.Controls.Canvas)(target));
     return;
     case 49:
     this.DepthDisplayPanel = ((AvalonDock.DockableContent)(target));
     return;
     case 50:
     this.depthDisplay = ((System.Windows.Controls.Image)(target));
     return;
     case 51:
     this.DevCtrlPanel = ((AvalonDock.DockablePane)(target));
     return;
     case 52:
     this.statusTB = ((System.Windows.Controls.TextBlock)(target));
     return;
     }
     this._contentLoaded = true;
 }
开发者ID:cdbean,项目名称:CAGA,代码行数:101,代码来源:MainWindow.g.i.cs


示例6: FloatingDocumentPane

 internal FloatingDocumentPane(DocumentFloatingWindow floatingWindow, DocumentContent documentToTransfer)
 {
     _floatingWindow = floatingWindow;
     _documentToTransfer = documentToTransfer;
 }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:5,代码来源:FloatingDocumentPane.cs


示例7: ExportLayoutToDocument

        private void ExportLayoutToDocument(object sender, RoutedEventArgs e)
        {
            DocumentContent doc = new DocumentContent()
            {
                Title = string.Format("Layout_{0}", DateTime.Now.ToString()),
                Content = new TextBox()
                {
                    AcceptsReturn = true,
                    VerticalScrollBarVisibility = ScrollBarVisibility.Auto,
                    HorizontalScrollBarVisibility = ScrollBarVisibility.Auto,
                    Text = DockManager.LayoutToString()
                }
            };

            doc.Show(DockManager);
            doc.Activate();
        }
开发者ID:Reticulatas,项目名称:AvalonDock,代码行数:17,代码来源:MainWindow.xaml.cs


示例8: RestoreResizingPanel

        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;
        }
开发者ID:alexcepoi,项目名称:ShareTabWin,代码行数:71,代码来源:DockingManager.cs


示例9: RestoreDocumentPaneLayout

        ///// <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;
//.........这里部分代码省略.........
开发者ID:alexcepoi,项目名称:ShareTabWin,代码行数:101,代码来源:DockingManager.cs


示例10: DocumentsSourceCollectionChanged

        void DocumentsSourceCollectionChanged(
            object sender, 
            NotifyCollectionChangedEventArgs e)
        {
            if (e.Action == NotifyCollectionChangedAction.Reset)
            {
                //close first documents that do not belong to the MainDocumentPane
                DocumentContent[] docs = this.Documents.ToArray();

                docs.Where(d => ((DocumentPane)d.Parent).IsMainDocumentPane.GetValueOrDefault()).ForEach(d => d.InternalClose());
                docs.Where(d => d.Parent != null && !((DocumentPane)d.Parent).IsMainDocumentPane.GetValueOrDefault()).ForEach(d => d.InternalClose());
            }

            if (e.OldItems != null &&
                (e.Action == NotifyCollectionChangedAction.Remove ||
                e.Action == NotifyCollectionChangedAction.Replace))
            {
                foreach (object newDoc in e.OldItems)
                {
                    if (newDoc is DocumentContent)
                    {
                        DocumentContent documentToAdd = newDoc as DocumentContent;
                        documentToAdd.InternalClose();
                    }
                    else if (newDoc is FrameworkElement)
                    {
                        DocumentContent docContainer = ((FrameworkElement)newDoc).Parent as DocumentContent;
                        if (docContainer != null)
                            docContainer.InternalClose();
                    }
                }
            }

            if (e.NewItems != null &&
                (e.Action == NotifyCollectionChangedAction.Add ||
                e.Action == NotifyCollectionChangedAction.Replace))
            {
                if (MainDocumentPane == null)
                    throw new InvalidOperationException("DockingManager must have at least a DocumentPane to host documents");

                foreach (object newDoc in e.NewItems)
                {
                    if (newDoc is DocumentContent)
                    {
                        DocumentContent documentToAdd = newDoc as DocumentContent;
                        if (documentToAdd.Parent is DocumentPane)
                        {
                            ((DocumentPane)documentToAdd.Parent).Items.Clear();
                        }

                        MainDocumentPane.Items.Add(documentToAdd);
                    }
                    else if (newDoc is UIElement) //limit objects to be at least framework elements
                    {
                        DocumentContent documentToAdd = new DocumentContent()
                        {
                            Content = newDoc
                        };

                        MainDocumentPane.Items.Add(documentToAdd);
                    }
                    else
                        throw new InvalidOperationException(string.Format("Unable to add type {0} as DocumentContent", newDoc));
                }
            }

            RefreshContents();
        }
开发者ID:alexcepoi,项目名称:ShareTabWin,代码行数:68,代码来源:DockingManager.cs


示例11: Show

        /// <summary>
        /// Show or add a document in AvalonDock
        /// </summary>
        /// <param name="document">Document to show/add.</param>
        /// <remarks>If document provided is not present in the <see cref="Documents"/> list, this method inserts it in first position of <see cref="MainDocumentPane.Items"/> collection.
        /// In both cases select it in the container <see cref="DocumentPane"/>.</remarks>
        internal void Show(DocumentContent document)
        {
            bool found = Documents.FirstOrDefault(d => d == document) != null;

            if (!found && MainDocumentPane != null)
            {
                if (document.Parent is DocumentPane)
                {
                    ((DocumentPane)document.Parent).Items.Clear();
                }

                MainDocumentPane.Items.Insert(0, document);
            }
        }
开发者ID:alexcepoi,项目名称:ShareTabWin,代码行数:20,代码来源:DockingManager.cs


示例12: Editor

 public Editor(DocumentContent window)
 {
     this.window = window;
     textBox = new TextBox();
     window.Content = textBox;
 }
开发者ID:conradz,项目名称:Edit5,代码行数:6,代码来源:Editor.cs


示例13: Drag

        internal void Drag(DocumentContent documentContent, Point point, Point offset)
        {
            if (CaptureMouse())
            {
                DocumentFloatingWindow floatingWindow = new DocumentFloatingWindow(this);
                floatingWindow.Owner = Window.GetWindow(this);
                floatingWindow.CopyInputBindingsFromOwner();
                floatingWindow.Content = documentContent;
                Drag(floatingWindow, point, offset);
            }

        }
开发者ID:Rpinski,项目名称:SharpDevelop,代码行数:12,代码来源:DockingManager.cs


示例14: InitGUITab

        /// <summary>
        /// Initialication of the GUIEditor Tab, creating the context menu for the GUIEditor elements
        /// </summary>
        private void InitGUITab()
        {
            // Context menu
            gUIComponentContextMenu = new ContextMenu();
            gUIComponentContextMenuResize = new MenuItem();
            gUIComponentContextMenuResize.Header = Properties.Resources.GUIEditorKeyboardResize;
            gUIComponentContextMenu.Items.Add(gUIComponentContextMenuResize);
            gUIComponentContextMenuResize.Click += gUIComponentContextMenuResize_Click;

            gUIComponentContextMenuResizeStop = new MenuItem();
            gUIComponentContextMenuResizeStop.Header = Properties.Resources.GUIEditorKeyboardResizeStop;
            gUIComponentContextMenuResizeStop.IsEnabled = false;
            gUIComponentContextMenu.Items.Add(gUIComponentContextMenuResizeStop);
            gUIComponentContextMenuResizeStop.Click += gUIComponentContextMenuResizeStop_Click;

            gUIComponentContextMenu.Items.Add(new Separator());
            gUIComponentContextMenuMove = new MenuItem();
            gUIComponentContextMenuMove.Header = Properties.Resources.GUIEditorKeyboardMove;
            gUIComponentContextMenu.Items.Add(gUIComponentContextMenuMove);
            gUIComponentContextMenuMove.Click += gUIComponentContextMenuMove_Click;

            gUIComponentContextMenuMoveStop = new MenuItem();
            gUIComponentContextMenuMoveStop.Header = Properties.Resources.GUIEditorKeyboardMoveStop;
            gUIComponentContextMenuMoveStop.IsEnabled = false;
            gUIComponentContextMenu.Items.Add(gUIComponentContextMenuMoveStop);
            gUIComponentContextMenuMoveStop.Click += gUIComponentContextMenuMoveStop_Click;

            // creating the tab fot the gui designer
            DockPanel guiDockPanel = new DockPanel();
            guiDockPanel.LastChildFill = true;

            guiScrollViewer = new ScrollViewer();
            guiScrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
            guiScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
            guiDockPanel.Children.Add(guiScrollViewer);

            guiCanvas = new Canvas();
            InitGUICanvas();
            guiCanvasBorder = new Border();
            guiCanvasBorder.BorderThickness = new Thickness(2);
            guiCanvasBorder.BorderBrush = Brushes.DarkGray;
            guiCanvasBorder.Width = guiCanvas.Width + 4;
            guiCanvasBorder.Height = guiCanvas.Height + 4;
            guiCanvasBorder.Child = guiCanvas;
            guiScrollViewer.Content = guiCanvasBorder;
            GUIEditorCanvas = new DocumentContent() {
                Title = Properties.Resources.DockGUIWindow,
                Content = guiDockPanel,
                Name = "dockGUIEditorWindowName"
            };
            GUIEditorCanvas.IsCloseable = false;
            GUIEditorCanvas.IsActiveDocumentChanged += GUIEditorCanvas_IsActiveDocumentChanged;
            GUIEditorCanvas.Show(dockManager);

            guiProp = new GUIProperties();
            guiProp.PropertyChanged += guiProp_PropertyChanged;

            // Adapt screen resolution. Screen width is 800
            switch (guiProp.ScreenRes) {
                case GUIProperties.ScreenResolution.FiveFour:
                    guiCanvas.Height = GUIFRAMEHEIGHTFIVEFOUR;
                    break;
                case GUIProperties.ScreenResolution.FourThree:
                    guiCanvas.Height = GUIFRAMEHEIGHTFOURTHREE;
                    break;
                case GUIProperties.ScreenResolution.SixteenNine:
                    guiCanvas.Height = GUIFRAMEHEIGHTSIXTEENNINE;
                    break;
            }

            guiGridCanvas = new Canvas();
            guiGridCanvas.Width = guiCanvas.Width;
            guiGridCanvas.Height = guiCanvas.Height;
            DrawGridLines();
            guiCanvas.Children.Add(guiGridCanvas);
            if (guiProp.ShowGrid == true) {
                guiGridCanvas.Visibility = System.Windows.Visibility.Visible;
            }
            else {
                guiGridCanvas.Visibility = System.Windows.Visibility.Hidden;
            }

            AddAREGUIComponent();
        }
开发者ID:Walid-Shouman,项目名称:AsTeRICS,代码行数:87,代码来源:MainWindowGUIEditor.cs


示例15: AddNewTab

 public void AddNewTab(DocumentContent newTab)
 {            
     this.DocumentManager.Items.Add(newTab);
     newTab.Focus();
 }
开发者ID:jacobmodayil,项目名称:GuestBookerStudio,代码行数:5,代码来源:InnerWindow.xaml.cs


示例16: BuildDockingLayout

        void BuildDockingLayout()
        {
            dockManager.Content = null;

            //TreeView dockable content
            var trv = new TreeView();
            trv.Items.Add(new TreeViewItem() { Header = "Item1" });
            trv.Items.Add(new TreeViewItem() { Header = "Item2" });
            trv.Items.Add(new TreeViewItem() { Header = "Item3" });
            trv.Items.Add(new TreeViewItem() { Header = "Item4" });
            ((TreeViewItem)trv.Items[0]).Items.Add(new TreeViewItem() { Header = "SubItem1" });
            ((TreeViewItem)trv.Items[0]).Items.Add(new TreeViewItem() { Header = "SubItem2" });
            ((TreeViewItem)trv.Items[1]).Items.Add(new TreeViewItem() { Header = "SubItem3" });
            ((TreeViewItem)trv.Items[2]).Items.Add(new TreeViewItem() { Header = "SubItem4" });
            var treeviewContent = new DockableContent() { Title = "Explorer", Content = trv };

            treeviewContent.Show(dockManager, AnchorStyle.Left);

            //TextBox invo dockable content
            var treeviewInfoContent = new DockableContent() { Title = "Explorer Info", Content = new TextBox() { Text = "Explorer Info Text", IsReadOnly = true } };
            treeviewContent.ContainerPane.Items.Add(treeviewInfoContent);


            //ListView dockable content
            var gridView = new GridView();
            gridView.Columns.Add(new GridViewColumn() { Header = "Date" });
            gridView.Columns.Add(new GridViewColumn() { Header = "Day Of Weeek", DisplayMemberBinding = new Binding("DayOfWeek") });
            gridView.Columns.Add(new GridViewColumn() { Header = "Year", DisplayMemberBinding = new Binding("Year") });
            gridView.Columns.Add(new GridViewColumn() { Header = "Month", DisplayMemberBinding = new Binding("Month") });
            gridView.Columns.Add(new GridViewColumn() { Header = "Second", DisplayMemberBinding = new Binding("Second") });
            var listView = new ListView() { View = gridView };
            listView.Items.Add(DateTime.Now);
            listView.Items.Add(DateTime.Now.AddYears(-1));
            listView.Items.Add(DateTime.Now.AddMonths(15));
            listView.Items.Add(DateTime.Now.AddHours(354));

            var listViewContent = new DockableContent() { Title = "Date & Times", Content = listView };
            listViewContent.ShowAsFloatingWindow(dockManager, true);

            //TextBox dockable content
            var textboxSampleContent = new DockableContent() { Title = "Date & Times Info", Content = new TextBox() { Text = "Date & Times Info Text", IsReadOnly = true } };
            listViewContent.ContainerPane.Items.Add(textboxSampleContent);


            //DataGrid document
            var dataGrid = new DataGrid();
            var rnd = new Random();
            var data = new List<Tuple<double, double, double, double>>();
            for (int i = 0; i < 100; i++)
            {
                data.Add(Tuple.Create(rnd.NextDouble(), rnd.NextDouble() * 10.0, rnd.NextDouble() * 100.0, rnd.NextDouble() * 1000.0));
            }

            dataGrid.ItemsSource = data;

            var dataGridDocument = new DocumentContent() { Title = "Data", IsLocked = true, Content = dataGrid };
            dataGridDocument.Show(dockManager);

            //DataGrid Info Text sample
            var dataGridInfoContent = new DockableContent() { Title = "Data Info", Content = new TextBox() { Text = "Data Info Text" } };
            dataGridInfoContent.ShowAsDocument(dockManager);

        }
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:63,代码来源:MainWindow.xaml.cs


示例17: ShowDocument

 /// <summary>
 /// Shows a document.  Puts it in the document pane.
 /// </summary>
 /// <param name="document"></param>
 public IDocument ShowDocument(IDocument document, string memento, bool makeActive)
 {
     IDocument doc = document.CreateDocument(memento);
     if (doc != null)
     {
         if (!m_documentLookup.ContainsKey(doc))
         {
             DocumentContent content = new DocumentContent();
             setManagedContentProperties(doc, content);
             m_documentLookup.Add(doc, content);
             m_docPane.Items.Add(content);
             // all these event handlers get unsubscribed in the content_Closing method
             doc.PropertyChanged += new PropertyChangedEventHandler(doc_PropertyChanged);
             content.Closing += new EventHandler<System.ComponentModel.CancelEventArgs>(doc.OnClosing);
             content.Closed += new EventHandler(content_Closed);
             content.GotFocus += new RoutedEventHandler(doc.OnGotFocus);
             content.LostFocus += new RoutedEventHandler(doc.OnLostFocus);
             document.OnOpened(content, new EventArgs());
         }
         m_documentLookup[doc].Show(DockManager);
         if (makeActive)
         {
             DockManager.ActiveDocument = m_documentLookup[doc];
         }
     }
     return doc;
 }
开发者ID:EdWeller,项目名称:SoapboxSnap,代码行数:31,代码来源:LayoutManager.cs


示例18: Drag

 internal void Drag(DocumentContent documentContent, Point point, Point offset)
 {
     if (CaptureMouse())
     {
         DocumentFloatingWindow floatingWindow = new DocumentFloatingWindow(this);
         floatingWindow.Content = documentContent;
         Drag(floatingWindow, point, offset);
     }
 }
开发者ID:alexcepoi,项目名称:ShareTabWin,代码行数:9,代码来源:DockingManager.cs


示例19: HandleDocumentOpen

 internal void HandleDocumentOpen(DocumentContent contentClosed)
 {
     IList listToUpdate = DocumentsSource as IList;
     if (listToUpdate != null)
         listToUpdate.Add(contentClosed);
 }
开发者ID:alexcepoi,项目名称:ShareTabWin,代码行数:6,代码来源:DockingManager.cs


示例20: CreateContentFor

 DocumentContent CreateContentFor(Document doc)
 {
     var content = new DocumentContent() {
         DataContext = doc,
         Content = new DocumentView(doc)
     };
     content.SetBinding(DocumentContent.TitleProperty, "Title");
     return content;
 }
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:9,代码来源:MainWindow.xaml.cs



注:本文中的AvalonDock.DocumentContent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AvalonDock.DocumentPane类代码示例发布时间:2022-05-24
下一篇:
C# AvalonDock.DockingManager类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap