本文整理汇总了C#中Xceed.Wpf.AvalonDock.Layout.LayoutRoot类的典型用法代码示例。如果您正苦于以下问题:C# LayoutRoot类的具体用法?C# LayoutRoot怎么用?C# LayoutRoot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LayoutRoot类属于Xceed.Wpf.AvalonDock.Layout命名空间,在下文中一共展示了LayoutRoot类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: AfterInsertAnchorable
public void AfterInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableShown)
{
// var toolViewModel = anchorableShown.Content as ToolViewModel;
// if (toolViewModel != null)
// {
// switch (toolViewModel.DefaultPane)
// {
// case DefaultToolPane.Left:
// case DefaultToolPane.Right:
// anchorableShown.AutoHideMinWidth = (double)toolViewModel.Width;
// anchorableShown.AutoHideWidth = (double)toolViewModel.Width;
// break;
// case DefaultToolPane.Bottom:
// anchorableShown.AutoHideMinHeight = (double)toolViewModel.Height;
// anchorableShown.AutoHideHeight = 100.0;
// break;
// }
// }
}
开发者ID:mookiejones,项目名称:miEditor,代码行数:19,代码来源:LayoutInitializer.cs
示例17: BeforeInsertContent
private bool BeforeInsertContent(LayoutRoot layout, LayoutContent anchorableToShow)
{
var viewModel = (ViewModelBase) anchorableToShow.Content;
var layoutContent =
layout.Descendents().OfType<LayoutContent>().FirstOrDefault(x => x.ContentId == viewModel.ContextId);
if (layoutContent == null)
return false;
layoutContent.Content = anchorableToShow.Content;
// Add layoutContent to it's previous container
var layoutContainer =
layoutContent.GetType()
.GetProperty("PreviousContainer", BindingFlags.NonPublic | BindingFlags.Instance)
.GetValue(layoutContent, null) as ILayoutContainer;
if (layoutContainer is LayoutAnchorablePane)
(layoutContainer as LayoutAnchorablePane).Children.Add(layoutContent as LayoutAnchorable);
else if (layoutContainer is LayoutDocumentPane)
(layoutContainer as LayoutDocumentPane).Children.Add(layoutContent);
else
throw new NotSupportedException();
return true;
}
开发者ID:gdv1811,项目名称:PdfCodeEditor,代码行数:21,代码来源:LayoutUpdateStategy.cs
示例18: BeforeInsertAnchorable
public bool BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer)
{
bool result = false;
if (layout != null
&& anchorableToShow != null)
{
var destPane = destinationContainer as LayoutAnchorablePane;
if (anchorableToShow.Root == null)
{
anchorableToShow.AddToLayout(layout.Manager, GetContentAnchorableStrategy(anchorableToShow));
bool isHidden = GetContentAnchorableIsHidden(anchorableToShow);
if (isHidden)
{
anchorableToShow.CanHide = true;
anchorableToShow.Hide();
}
result = true;
}
else if (destPane != null && anchorableToShow.IsHidden)
{
// Show a hidden Anchorable.
if (anchorableToShow.PreviousContainerIndex < 0)
{
destPane.Children.Add(anchorableToShow);
}
else
{
int insertIndex = anchorableToShow.PreviousContainerIndex;
if (insertIndex > destPane.ChildrenCount)
{
insertIndex = destPane.ChildrenCount;
}
destPane.Children.Insert(insertIndex, anchorableToShow);
}
result = true;
}
}
return result || m_WrappedStrategy.BeforeInsertAnchorable(layout, anchorableToShow, destinationContainer);
}
开发者ID:countincognito,项目名称:Zametek.PrismEx.AvalonDock,代码行数:39,代码来源:DockingManagerRegionAdapterLayoutStrategy.cs
示例19: AfterInsertAnchorable
/// <summary>
/// アンカー挿入後の処理です。
/// </summary>
/// <param name="layout">レイアウトです。</param>
/// <param name="anchorableShown">アンカーの表示状態です。</param>
public void AfterInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableShown)
{
var tool = anchorableShown.Content as IToolable;
if (tool != null)
{
var anchorablePane = anchorableShown.Parent as LayoutAnchorablePane;
if (anchorablePane != null && anchorablePane.ChildrenCount == 1)
{
switch (tool.Location)
{
case PanelLocation.Left:
case PanelLocation.Right:
anchorablePane.DockWidth = new GridLength(tool.Width, GridUnitType.Pixel);
break;
case PanelLocation.Bottom:
anchorablePane.DockHeight = new GridLength(tool.Height, GridUnitType.Pixel);
break;
default:
anchorablePane.DockWidth = new GridLength(tool.Width, GridUnitType.Pixel);
break;
}
}
}
}
开发者ID:kenny-nelson,项目名称:GomiBako,代码行数:29,代码来源:LayoutUpdater.cs
示例20: AfterInsertAnchorable
public void AfterInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableShown)
{
// If this is the first anchorable added to this pane, then use the preferred size.
var tool = anchorableShown.Content as ITool;
if (tool != null)
{
var anchorablePane = anchorableShown.Parent as LayoutAnchorablePane;
if (anchorablePane != null && anchorablePane.ChildrenCount == 1)
{
switch (tool.PreferredLocation)
{
case PaneLocation.Left:
case PaneLocation.Right:
anchorablePane.DockWidth = new GridLength(tool.PreferredWidth, GridUnitType.Pixel);
break;
case PaneLocation.Bottom:
anchorablePane.DockHeight = new GridLength(tool.PreferredHeight, GridUnitType.Pixel);
break;
default:
throw new ArgumentOutOfRangeException();
}
}
}
}
开发者ID:ruisebastiao,项目名称:Wide,代码行数:24,代码来源:LayoutInitializer.cs
注:本文中的Xceed.Wpf.AvalonDock.Layout.LayoutRoot类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论