当前位置: 首页>>代码示例>>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;未经允许,请勿转载。