当前位置: 首页>>代码示例>>C#>>正文


C# Layout.LayoutAnchorable类代码示例

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


LayoutAnchorable类属于Xceed.Wpf.AvalonDock.Layout命名空间,在下文中一共展示了LayoutAnchorable类的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: Attach

        internal override void Attach(LayoutContent model)
        {
            _anchorable = model as LayoutAnchorable;
            _anchorable.IsVisibleChanged += new EventHandler(_anchorable_IsVisibleChanged);

            base.Attach(model);
        }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:7,代码来源:LayoutAnchorableItem.cs

示例3: 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

示例4: 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

示例5: 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

示例6: AddPanel

 public void AddPanel(LayoutAnchorable panel)
 {
     if (!_Panels.Contains(panel))
     {
         _Panels.Add(panel);
     }
 }
开发者ID:gilgame,项目名称:SEWorkbench,代码行数:7,代码来源:DockLayoutManager.cs

示例7: LayoutAnchorControl

        internal LayoutAnchorControl(LayoutAnchorable model)
        {
            _model = model;
            _model.IsActiveChanged += new EventHandler(_model_IsActiveChanged);
            _model.IsSelectedChanged += new EventHandler(_model_IsSelectedChanged);

            SetSide(_model.FindParent<LayoutAnchorSide>().Side);
        }
开发者ID:qjw2bqn,项目名称:Esri-Geometry-Network-Configuration-Manager,代码行数:8,代码来源:LayoutAnchorControl.cs

示例8: addToAnchorablePane

 /// <summary>
 /// Method that adds to the GraphicsContainer a LayoutAnchorable that contains a Data visualizer user control
 /// </summary>
 /// <param name="objectToAdd"></param>
 public void addToAnchorablePane(UserControl objectToAdd, string Title)
 {
     LayoutAnchorable doc = new LayoutAnchorable();
     doc.Hiding += doc_Hiding;
     doc.CanHide = true;
     doc.CanClose = true;
     doc.Title = Title;
     doc.Content = objectToAdd;
     doc.AddToLayout(containersManager, AnchorableShowStrategy.Right);
 }
开发者ID:RubenAgudo,项目名称:MIPS,代码行数:14,代码来源:MainWindow.xaml.cs

示例9: 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

示例10: Button_Click

 private void Button_Click(object sender, RoutedEventArgs e)
 {
     IDockingViewManager dockingViewManager = _container.Resolve<DockingViewManager>(); // ServiceLocator.Current.GetInstance<DockingViewManager>();
     string viewType = (sender as Button).Content as string;
     UserControl view = new UserControl();
     if (viewType == "Dur") view = dockingViewManager.GetDockingView(WellknowViewName.DurationTraderView);
     if (viewType == "5-10YR") view = dockingViewManager.GetDockingView(WellknowViewName._5_10Yr);
     
     LayoutAnchorable a1 = new LayoutAnchorable() {Content=view, Title="Floating", FloatingWidth = 600, FloatingHeight = 400, FloatingLeft=50, FloatingTop=50 };
     a1.AddToLayout(dockingManager, AnchorableShowStrategy.Most);
     a1.Float();
   
 }
开发者ID:jqd072014,项目名称:code.root,代码行数:13,代码来源:ShellWindow.xaml.cs

示例11: AddDocWpf

        /// <summary>
        /// 加入新的Window到文档口(WPF Only)
        /// </summary>
        /// <param name="wd">WPF窗口</param>
        /// <param name="title">标题</param>
        public void AddDocWpf(Object wd, String title)
        {
            var docPane = _dManager.Layout.Descendents().OfType<LayoutDocumentPane>().First();
            var doc = new LayoutAnchorable
            {
                Title = title,
                Content = wd,
                IsSelected = true,
                CanAutoHide = true
            };

            if (docPane != null) docPane.Children.Add(doc);
        }
开发者ID:XXZZQQ,项目名称:XZQ,代码行数:18,代码来源:DockPage.cs

示例12: AddDocForm

        /// <summary>
        /// 加入新的WinForm到文档口(WPF Only)
        /// </summary>
        public void AddDocForm(UserControl uc, String title)
        {
            var docPane = _dManager.Layout.Descendents().OfType<LayoutDocumentPane>().First();

            var doc = new LayoutAnchorable
            {
                Title = title,
                Content = new WindowsFormsHost { Child = uc },
                IsSelected = true,
                CanAutoHide = true
            };

            docPane.Children.Add(doc);
        }
开发者ID:XXZZQQ,项目名称:XZQ,代码行数:17,代码来源:DockPage.cs

示例13: 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

示例14: 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

示例15: 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


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