當前位置: 首頁>>代碼示例>>C#>>正文


C# Layout.LayoutRoot類代碼示例

本文整理匯總了C#中Xceed.Wpf.AvalonDock.Layout.LayoutRoot的典型用法代碼示例。如果您正苦於以下問題:C# LayoutRoot類的具體用法?C# LayoutRoot怎麽用?C# LayoutRoot使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


LayoutRoot類屬於Xceed.Wpf.AvalonDock.Layout命名空間,在下文中一共展示了LayoutRoot類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AfterInsertAnchorable

 public void AfterInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableShown)
 {
     var content = anchorableShown.Content as PaneViewModel;
     if(content != null && content.DoFloating)
     {
         anchorableShown.Float();
     }
 }
開發者ID:jg-maon,項目名稱:gpeWPF,代碼行數:8,代碼來源:LayoutInitializer.cs

示例2: BeforeInsertAnchorable

        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
        {           
            //Determine panel name for given view model type
            string destPaneName = string.Empty;
            if (anchorableToShow.Content is JadeControls.Workspace.ViewModel.WorkspaceViewModel ||
                anchorableToShow.Content is JadeControls.SymbolInspector.SymbolInspectorPaneViewModel ||
                anchorableToShow.Content is JadeControls.CursorInspector.CursorInspectorPaneViewModel)
            {
                destPaneName = "LeftToolPanel";
            }
            else if (anchorableToShow.Content is JadeControls.OutputControl.ViewModel.OutputViewModel ||
                    anchorableToShow.Content is JadeControls.SearchResultsControl.ViewModel.SearchResultsPaneViewModel)
            {
                destPaneName = "LowerToolPanel";
            }
            else if (anchorableToShow.Content is JadeControls.ContextTool.ContextPaneViewModel)
            {
                destPaneName = "RightToolPanel";
            }
            else
            {
                return false;
            }

            //Find pane
            var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == destPaneName);
            if (toolsPane != null)
            {
                //Add
                toolsPane.Children.Add(anchorableToShow);
                return true;
            } 
            return false;
        }
開發者ID:JadeHub,項目名稱:Jade,代碼行數:34,代碼來源:LayoutInitializer.cs

示例3: BeforeInsertAnchorable

        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
        {
            if (destinationContainer != null &&
                destinationContainer.FindParent<LayoutFloatingWindow>() != null)
            {
                return false;
            }

            foreach (var viewModelPane in ViewModelPanes)
            {
                if (viewModelPane.Item1.IsInstanceOfType(anchorableToShow.Content))
                {
                    var pane = layout
                        .Descendents()
                        .OfType<LayoutAnchorablePane>()
                        .SingleOrDefault(p => p.Name == viewModelPane.Item2);

                    if (pane != null)
                    {
                        pane.Children.Add(anchorableToShow);

                        if (viewModelPane.Item3)
                        {
                            anchorableToShow.ToggleAutoHide();
                        }

                        return true;
                    }
                }
            }

            return false;
        }
開發者ID:joaope,項目名稱:flowstudio,代碼行數:33,代碼來源:LayoutUpdateStategy.cs

示例4: CreateAnchorablePane

        private static LayoutAnchorablePane CreateAnchorablePane(LayoutRoot layout, Orientation orientation,
            string paneName, InsertPosition position)
        {
            var layoutPanels = layout.Descendents().OfType<LayoutPanel>().ToArray();
            var parent = layoutPanels.FirstOrDefault(d => d != null && d.Orientation == orientation);
            if (parent == null)
            {
                parent = layoutPanels.FirstOrDefault();
                position = InsertPosition.Start;
            }
            var toolsPane = new LayoutAnchorablePane { Name = paneName };
            if (parent != null)
            {
                if (position == InsertPosition.Start)
                    parent.InsertChildAt(0, toolsPane);
                else
                    parent.Children.Add(toolsPane);
            }
            else
            {
                var layoutAnchorableFloatingWindow = new LayoutAnchorableFloatingWindow();
                toolsPane.Parent = layoutAnchorableFloatingWindow;

            }
            return toolsPane;
        }
開發者ID:julianpaulozzi,項目名稱:EntityProfiler,代碼行數:26,代碼來源:LayoutInitializer.cs

示例5: BeforeInsertAnchorable

        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
        {
            var tool = anchorableToShow.Content as ITool;
            if (tool != null)
            {
                var preferredLocation = tool.PreferredLocation;
                string paneName = GetPaneName(preferredLocation);
                var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == paneName);
                if (toolsPane == null)
                {
                    switch (preferredLocation)
                    {
                        case PaneLocation.Left:
                            toolsPane = CreateAnchorablePane(layout, Orientation.Horizontal, paneName, InsertPosition.Start);
                            break;
                        case PaneLocation.Right:
                            toolsPane = CreateAnchorablePane(layout, Orientation.Horizontal, paneName, InsertPosition.End);
                            break;
                        case PaneLocation.Bottom:
                            toolsPane = CreateAnchorablePane(layout, Orientation.Vertical, paneName, InsertPosition.End);
                            break;
                        default:
                            throw new ArgumentOutOfRangeException();
                    }
                }
                toolsPane.Children.Add(anchorableToShow);
                return true;
            }

            return false;
        }
開發者ID:ruisebastiao,項目名稱:Wide,代碼行數:31,代碼來源:LayoutInitializer.cs

示例6: DockingManager

        public DockingManager()
        {
            Layout = new LayoutRoot() { RootPanel = new LayoutPanel(new LayoutDocumentPaneGroup(new LayoutDocumentPane())) };


            this.Loaded += new RoutedEventHandler(DockingManager_Loaded);
            this.Unloaded += new RoutedEventHandler(DockingManager_Unloaded);
        }
開發者ID:Alexz18z35z,項目名稱:Gibbo2D,代碼行數:8,代碼來源:DockingManager.cs

示例7: AfterInsertDocument

		public void AfterInsertDocument(LayoutRoot layout, LayoutDocument anchorableShown)
		{
			var parent = anchorableShown.Parent as LayoutDocumentPane;
			if (parent == null)
				parent = anchorableShown.FindParent<LayoutDocumentPane>();
			if (parent != null)
			{
			}
		}
開發者ID:saeednazari,項目名稱:Rubezh,代碼行數:9,代碼來源:LayoutUpdateStrategy.cs

示例8: DockingManager

		public DockingManager()
		{
			Layout = new LayoutRoot() { RootPanel = new LayoutPanel(new LayoutDocumentPaneGroup(new LayoutDocumentPane())) };

			EventManager.RegisterClassHandler(typeof(Window), Keyboard.PreviewKeyDownEvent, new KeyEventHandler(GlobalPreviewKeyDownEvent), true);

			this.Loaded += new RoutedEventHandler(DockingManager_Loaded);
			this.Unloaded += new RoutedEventHandler(DockingManager_Unloaded);
		}
開發者ID:saeednazari,項目名稱:Rubezh,代碼行數:9,代碼來源:DockingManager.cs

示例9: DockingManager

        public DockingManager()
        {
#if !VS2008
          Layout = new LayoutRoot() { RootPanel = new LayoutPanel(new LayoutDocumentPaneGroup(new LayoutDocumentPane())) };
#else
          this.SetCurrentValue( DockingManager.LayoutProperty, new LayoutRoot() { RootPanel = new LayoutPanel(new LayoutDocumentPaneGroup(new LayoutDocumentPane())) } );
#endif
          this.Loaded += new RoutedEventHandler(DockingManager_Loaded);
          this.Unloaded += new RoutedEventHandler(DockingManager_Unloaded);
        }
開發者ID:austinedeveloper,項目名稱:WpfExtendedToolkit,代碼行數:10,代碼來源:DockingManager.cs

示例10: BeforeInsertAnchorable

        //http://avalondock.codeplex.com/wikipage?title=AvalonDock%202.0%20Getting%20Start%20Guide&referringTitle=Documentation
		public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
		{
            if (anchorableToShow.Content is ITool)
            {
                var preferredLocation = ((ITool) anchorableToShow.Content).PreferredLocation;
                string paneName = GetPaneName(preferredLocation);
                var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == paneName);
                if (toolsPane == null)
                {
                    switch (preferredLocation)
                    {
                        case PaneLocation.Left:
                        {
                            //TODO: this should use two steps: first, try to add to existing "LayoutAnchorablePane" if not create layoutAnchorGroup like below
                            var layoutAnchorSide = layout.Descendents().OfType<LayoutAnchorSide>().First(side => side.Side == AnchorSide.Left);
                            var layoutAnchorGroup = new LayoutAnchorGroup();
                            layoutAnchorGroup.InsertChildAt(0, anchorableToShow);
                            layoutAnchorSide.InsertChildAt(0, layoutAnchorGroup);
                            anchorableToShow.AutoHideWidth = 200;

                            //var parent = layout.Descendents().OfType<LayoutPanel>().First(d => d.Orientation == Orientation.Horizontal);
                            //toolsPane = new LayoutAnchorablePane { DockWidth = new GridLength(200, GridUnitType.Pixel) };
                        }
                            break;
                        case PaneLocation.Right:
                        {
                            var parent = layout.Descendents().OfType<LayoutPanel>().First(d => d.Orientation == Orientation.Horizontal);
                            toolsPane = new LayoutAnchorablePane { DockWidth = new GridLength(200, GridUnitType.Pixel) };
                            parent.Children.Add(toolsPane);
                        }
                            break;
                        case PaneLocation.Bottom:
                        {
                            var ds = layout.Descendents().ToList();
                            var items = layout.Descendents().OfType<LayoutPanel>().ToList();
                            var items2 = layout.Descendents().OfType<LayoutAnchorGroup>().ToList();
                            //var parent = items2.First();
                            var parent = layout.Descendents().OfType<LayoutPanel>().First(d => d.Orientation == Orientation.Vertical);
                            toolsPane = new LayoutAnchorablePane { DockHeight = new GridLength(300, GridUnitType.Pixel) };
                            parent.Children.Add(toolsPane);
                        }
                            break;
                        default:
                            throw new ArgumentOutOfRangeException();
                    }
                }
                if(toolsPane != null)
                    toolsPane.Children.Add(anchorableToShow);
                return true;
            }

			return false;
		}
開發者ID:CedarLogic,項目名稱:CShell,代碼行數:54,代碼來源:LayoutInitializer.cs

示例11: BeforeInsertAnchorable

        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
        {
            if (destinationContainer != null &&
                destinationContainer.FindParent<LayoutFloatingWindow>() != null)
                return false;

            var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "ToolsPane");
            if (toolsPane != null)
            {
                toolsPane.Children.Add(anchorableToShow);
                return true;
            }

            return false;
        }
開發者ID:Orcomp,項目名稱:NPerfRunner,代碼行數:15,代碼來源:LayoutInitializer.cs

示例12: BeforeInsertAnchorable

        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
        {
            var myViewModel = anchorableToShow.Content as IToolWindow;
            if (myViewModel != null)
            {
                var lap = layout.Descendents();
                var pane = lap.OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == myViewModel.DefaultDockingPane);
                if (pane != null)
                {
                    pane.Children.Add(anchorableToShow);
                    return true;
                }
            }

            return false;
        }
開發者ID:votrongdao,項目名稱:DaxStudio,代碼行數:16,代碼來源:DaxStudioLayoutStrategy.cs

示例13: BeforeInsertAnchorable

        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorable, ILayoutContainer destination)
        {
            LayoutAnchorablePane pane = destination as LayoutAnchorablePane;
            if (destination != null && destination.FindParent<LayoutFloatingWindow>() != null)
            {
                return false;
            }

            LayoutAnchorablePane files = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "pnFiles");
            if (files != null)
            {
                files.Children.Add(anchorable);
                return true;
            }
            return false;
        }
開發者ID:gilgame,項目名稱:SEWorkbench,代碼行數:16,代碼來源:FileLayoutStrategy.cs

示例14: BeforeInsertAnchorable

        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
        {
            //AD wants to add the anchorable into destinationContainer
            //just for test provide a new anchorablepane
            //if the pane is floating let the manager go ahead
            LayoutAnchorablePane destPane = destinationContainer as LayoutAnchorablePane;
            if (destinationContainer != null &&
                destinationContainer.FindParent<LayoutFloatingWindow>() != null)
                return false;

            if (anchorableToShow.Content is SectionBrowserViewModel)
            {
                var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "SectionBrowserPane");
                if (toolsPane != null)
                {
                   // anchorableToShow.CanHide = false;
                    toolsPane.Children.Add(anchorableToShow);
                    return true;
                }
            }

            if (anchorableToShow.Content is BlockGroupBrowserViewModel)
            {
                var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "BlockGroupBrowserPane");
                if (toolsPane != null)
                {
                   // anchorableToShow.CanHide = false;
                    toolsPane.Children.Add(anchorableToShow);
                    return true;
                }
            }

            if (anchorableToShow.Content is BlockOutputPreviewViewModel)
            {
                var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "BlockOutputPreviewPane");
                if (toolsPane != null)
                {
                    toolsPane.Children.Add(anchorableToShow);
                    return true;
                }
            }

            return false;
        }
開發者ID:BourbonCrow,項目名稱:Filtration,代碼行數:44,代碼來源:LayoutInitializer.cs

示例15: BeforeInsertAnchorable

        public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
        {
            //AD wants to add the anchorable into destinationContainer
            //just for test provide a new anchorablepane
            //if the pane is floating let the manager go ahead
            //LayoutAnchorablePane destPane = destinationContainer as LayoutAnchorablePane;
            //if (destinationContainer != null &&
            //    destinationContainer.FindParent<LayoutFloatingWindow>() != null)
            //    return false;

            //var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "ToolsPane");
            //if (toolsPane != null)
            //{
            //    toolsPane.Children.Add(anchorableToShow);
            //    return true;
            //}

            return false;
        }
開發者ID:Thor132,項目名稱:CSProto,代碼行數:19,代碼來源:LayoutInitializer.cs


注:本文中的Xceed.Wpf.AvalonDock.Layout.LayoutRoot類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。