本文整理汇总了C#中LayoutContent类的典型用法代码示例。如果您正苦于以下问题:C# LayoutContent类的具体用法?C# LayoutContent怎么用?C# LayoutContent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LayoutContent类属于命名空间,在下文中一共展示了LayoutContent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Attach
internal override void Attach(LayoutContent model)
{
_anchorable = model as LayoutAnchorable;
_anchorable.IsVisibleChanged += new EventHandler(_anchorable_IsVisibleChanged);
base.Attach(model);
}
开发者ID:Guiedo,项目名称:BehaviorIsManaged,代码行数:7,代码来源:LayoutAnchorableItem.cs
示例2: Attach
internal virtual void Attach(LayoutContent model)
{
LayoutElement = model;
Model = model.Content;
InitDefaultCommands();
LayoutElement.IsSelectedChanged+=new EventHandler(LayoutElement_IsSelectedChanged);
LayoutElement.IsActiveChanged+=new EventHandler(LayoutElement_IsActiveChanged);
DataContext = this;
}
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:12,代码来源:LayoutItem.cs
示例3: Attach
internal virtual void Attach(LayoutContent model)
{
LayoutElement = model;
Model = model.Content;
InitDefaultCommands();
LayoutElement.IsSelectedChanged += LayoutElement_IsSelectedChanged;
LayoutElement.IsActiveChanged += LayoutElement_IsActiveChanged;
DataContext = this;
Trace.WriteLine(string.Format("Attach({0})", LayoutElement.Title));
}
开发者ID:x-skywalker,项目名称:CodeMask,代码行数:13,代码来源:LayoutItem.cs
示例4: Attach
internal virtual void Attach(LayoutContent model)
{
LayoutElement = model;
Model = model.Content;
InitDefaultCommands();
LayoutElement.IsSelectedChanged += new EventHandler(LayoutElement_IsSelectedChanged);
LayoutElement.IsActiveChanged += new EventHandler(LayoutElement_IsActiveChanged);
DataContext = this;
System.Diagnostics.Trace.WriteLine(string.Format("Attach({0})", LayoutElement.Title));
}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:13,代码来源:LayoutItem.cs
示例5: 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
示例6: _ExecuteContentActivateCommand
internal void _ExecuteContentActivateCommand(LayoutContent content)
{
content.IsActive = true;
}
开发者ID:philt5252,项目名称:GoldenHorse,代码行数:4,代码来源:DockingManager.cs
示例7: _ExecuteCloseAllButThisCommand
internal void _ExecuteCloseAllButThisCommand(LayoutContent contentSelected)
{
foreach (var contentToClose in Layout.Descendents().OfType<LayoutContent>().Where(d => d != contentSelected && (d.Parent is LayoutDocumentPane || d.Parent is LayoutDocumentFloatingWindow)).ToArray())
{
if (!contentToClose.CanClose)
continue;
var layoutItem = GetLayoutItemFromModel(contentToClose);
if (layoutItem.CloseCommand != null)
{
if (layoutItem.CloseCommand.CanExecute(null))
layoutItem.CloseCommand.Execute(null);
}
else
{
if (contentToClose is LayoutDocument)
_ExecuteCloseCommand(contentToClose as LayoutDocument);
else if (contentToClose is LayoutAnchorable)
_ExecuteCloseCommand(contentToClose as LayoutAnchorable);
}
}
}
开发者ID:philt5252,项目名称:GoldenHorse,代码行数:22,代码来源:DockingManager.cs
示例8: StartDraggingFloatingWindowForContent
internal void StartDraggingFloatingWindowForContent(LayoutContent contentModel, bool startDrag = true)
{
if (!contentModel.CanFloat)
return;
var contentModelAsAnchorable = contentModel as LayoutAnchorable;
if (contentModelAsAnchorable != null &&
contentModelAsAnchorable.IsAutoHidden)
contentModelAsAnchorable.ToggleAutoHide();
var parentPane = contentModel.Parent as ILayoutPane;
var parentPaneAsPositionableElement = contentModel.Parent as ILayoutPositionableElement;
var parentPaneAsWithActualSize = contentModel.Parent as ILayoutPositionableElementWithActualSize;
var contentModelParentChildrenIndex = parentPane.Children.ToList().IndexOf(contentModel);
if (contentModel.FindParent<LayoutFloatingWindow>() == null)
{
((ILayoutPreviousContainer)contentModel).PreviousContainer = parentPane;
contentModel.PreviousContainerIndex = contentModelParentChildrenIndex;
}
parentPane.RemoveChildAt(contentModelParentChildrenIndex);
double fwWidth = contentModel.FloatingWidth;
double fwHeight = contentModel.FloatingHeight;
if (fwWidth == 0.0)
fwWidth = parentPaneAsPositionableElement.FloatingWidth;
if (fwHeight == 0.0)
fwHeight = parentPaneAsPositionableElement.FloatingHeight;
if (fwWidth == 0.0)
fwWidth = parentPaneAsWithActualSize.ActualWidth;
if (fwHeight == 0.0)
fwHeight = parentPaneAsWithActualSize.ActualHeight;
LayoutFloatingWindow fw;
LayoutFloatingWindowControl fwc;
if (contentModel is LayoutAnchorable)
{
var anchorableContent = contentModel as LayoutAnchorable;
fw = new LayoutAnchorableFloatingWindow()
{
RootPanel = new LayoutAnchorablePaneGroup(
new LayoutAnchorablePane(anchorableContent)
{
DockWidth = parentPaneAsPositionableElement.DockWidth,
DockHeight = parentPaneAsPositionableElement.DockHeight,
DockMinHeight = parentPaneAsPositionableElement.DockMinHeight,
DockMinWidth = parentPaneAsPositionableElement.DockMinWidth,
FloatingLeft = parentPaneAsPositionableElement.FloatingLeft,
FloatingTop = parentPaneAsPositionableElement.FloatingTop,
FloatingWidth = parentPaneAsPositionableElement.FloatingWidth,
FloatingHeight = parentPaneAsPositionableElement.FloatingHeight,
})
};
Layout.FloatingWindows.Add(fw);
fwc = new LayoutAnchorableFloatingWindowControl(
fw as LayoutAnchorableFloatingWindow)
{
Width = fwWidth,
Height = fwHeight,
Left = contentModel.FloatingLeft,
Top = contentModel.FloatingTop
};
}
else
{
var anchorableDocument = contentModel as LayoutDocument;
fw = new LayoutDocumentFloatingWindow()
{
RootDocument = anchorableDocument
};
Layout.FloatingWindows.Add(fw);
fwc = new LayoutDocumentFloatingWindowControl(
fw as LayoutDocumentFloatingWindow)
{
Width = fwWidth,
Height = fwHeight,
Left = contentModel.FloatingLeft,
Top = contentModel.FloatingTop
};
}
//fwc.Owner = Window.GetWindow(this);
//fwc.SetParentToMainWindowOf(this);
_fwList.Add(fwc);
Layout.CollectGarbage();
UpdateLayout();
Dispatcher.BeginInvoke(new Action(() =>
{
if (startDrag)
fwc.AttachDrag();
//.........这里部分代码省略.........
开发者ID:philt5252,项目名称:GoldenHorse,代码行数:101,代码来源:DockingManager.cs
示例9: LayoutSerializationCallbackEventArgs
public LayoutSerializationCallbackEventArgs(LayoutContent model, object previousContent)
{
Cancel = false;
Model = model;
Content = previousContent;
}
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:6,代码来源:LayoutSerializationCallbackEventArgs.cs
示例10: Attach
internal override void Attach(LayoutContent model)
{
_document = model as LayoutDocument;
base.Attach(model);
}
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:5,代码来源:LayoutDocumentItem.cs
示例11: Close
private void Close( LayoutContent contentToClose )
{
if( !contentToClose.CanClose )
return;
var layoutItem = GetLayoutItemFromModel( contentToClose );
if( layoutItem.CloseCommand != null )
{
if( layoutItem.CloseCommand.CanExecute( null ) )
layoutItem.CloseCommand.Execute( null );
}
else
{
if( contentToClose is LayoutDocument )
_ExecuteCloseCommand( contentToClose as LayoutDocument );
else if( contentToClose is LayoutAnchorable )
_ExecuteCloseCommand( contentToClose as LayoutAnchorable );
}
}
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:19,代码来源:DockingManager.cs
示例12: GetLayoutItemFromModel
/// <summary>
/// Return the LayoutItem wrapper for the content passed as argument
/// </summary>
/// <param name="content">LayoutContent to search</param>
/// <returns>Either a LayoutAnchorableItem or LayoutDocumentItem which contains the LayoutContent passed as argument</returns>
public LayoutItem GetLayoutItemFromModel(LayoutContent content)
{
return _layoutItems.FirstOrDefault(item => item.LayoutElement == content);
}
开发者ID:philt5252,项目名称:GoldenHorse,代码行数:9,代码来源:DockingManager.cs
示例13: _ExecuteDockAsDocumentCommand
internal void _ExecuteDockAsDocumentCommand(LayoutContent content)
{
content.DockAsDocument();
}
开发者ID:philt5252,项目名称:GoldenHorse,代码行数:4,代码来源:DockingManager.cs
示例14: _ExecuteDockAsDocumentCommand
internal void _ExecuteDockAsDocumentCommand(LayoutContent content)
{
content.DockAsDocument();
OnLayoutConfigurationChanged();
}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:5,代码来源:DockingManager.cs
示例15: _ExecuteFloatCommand
internal void _ExecuteFloatCommand(LayoutContent contentToFloat)
{
contentToFloat.Float();
OnLayoutConfigurationChanged();
}
开发者ID:saeednazari,项目名称:Rubezh,代码行数:5,代码来源:DockingManager.cs
示例16: ConvertView
ViewInfo ConvertView(LayoutContent child)
{
var v = new ViewInfo();
if (child is DocumentViewControl)
{
v.InternalName = (child as DocumentViewControl).View.InternalName;
}
else
throw new NotSupportedException();
return v;
}
开发者ID:chienhao10,项目名称:FinalesFunkeln,代码行数:11,代码来源:WindowInfo.cs
示例17: LayoutDocumentPaneEx
public LayoutDocumentPaneEx(LayoutContent firstChild)
: base(firstChild)
{
}
开发者ID:jg-maon,项目名称:gpeWPF,代码行数:4,代码来源:LayoutDocumentPaneEx.cs
示例18: Add
public void Add(string contentKey, LayoutContent content)
{
content.Closed += (s, e) => { Remove(contentKey); };
m_Contents.Add(contentKey.ToSafeString().ToLower(), content);
}
开发者ID:eolandezhang,项目名称:Diagram,代码行数:5,代码来源:LayoutContentCollection.cs
示例19: _ExecuteFloatCommand
internal void _ExecuteFloatCommand(LayoutContent contentToFloat)
{
contentToFloat.Float();
}
开发者ID:philt5252,项目名称:GoldenHorse,代码行数:4,代码来源:DockingManager.cs
示例20: Attach
internal override void Attach(LayoutContent model)
{
_anchorable = model as LayoutAnchorable;
if (_anchorable != null)
_anchorable.IsVisibleChanged += _anchorable_IsVisibleChanged;
base.Attach(model);
}
开发者ID:vebin,项目名称:ModernApplicationFramework,代码行数:8,代码来源:LayoutAnchorableItem.cs
注:本文中的LayoutContent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论