本文整理汇总了C#中AvalonDock.DockablePane.RemoveContent方法的典型用法代码示例。如果您正苦于以下问题:C# DockablePane.RemoveContent方法的具体用法?C# DockablePane.RemoveContent怎么用?C# DockablePane.RemoveContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AvalonDock.DockablePane
的用法示例。
在下文中一共展示了DockablePane.RemoveContent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DropInto
internal void DropInto(DockablePane paneDragged, DockablePane paneToDropInto)
{
//transfer tha contents of dragged pane (conatined in a FloatingWindow)
//to the pane which user select, taking care of setting contents state
//to Dock (using Dock() method of class DockablePane).
while (paneDragged.Items.Count > 0)
{
ManagedContent contentToTransfer = paneDragged.RemoveContent(0);
paneToDropInto.Items.Add(contentToTransfer);
DockableContent dockContentToTransfer = contentToTransfer as DockableContent;
if (dockContentToTransfer != null)
dockContentToTransfer.SetStateToDock();
}
paneToDropInto.SelectedIndex = paneToDropInto.Items.Count - 1;
//paneToDropInto.Focus();
}
示例2: DockableFloatingWindow
public DockableFloatingWindow(DockingManager manager, DockablePane dockablePane)
: this(manager)
{
//create a new temporary pane
FloatingDockablePane pane = new FloatingDockablePane(this);
//setup window size
ManagedContent selectedContent = dockablePane.SelectedItem as ManagedContent;
if (selectedContent != null && selectedContent.FloatingWindowSize.IsEmpty)
selectedContent.FloatingWindowSize = new Size(dockablePane.ActualWidth, dockablePane.ActualHeight);
if (selectedContent != null)
{
Width = selectedContent.FloatingWindowSize.Width;
Height = selectedContent.FloatingWindowSize.Height;
this.ResizeMode = selectedContent.FloatingResizeMode;
}
else
{
Width = dockablePane.ActualWidth;
Height = dockablePane.ActualHeight;
}
//transfer the style from the original dockablepane
pane.Style = dockablePane.Style;
//Width = dockablePane.ActualWidth;
//Height = dockablePane.ActualHeight;
////save current content position in container pane
//pane.SetValue(ResizingPanel.ResizeWidthProperty, dockablePane.GetValue(ResizingPanel.ResizeWidthProperty));
//pane.SetValue(ResizingPanel.ResizeHeightProperty, dockablePane.GetValue(ResizingPanel.ResizeHeightProperty));
int selectedIndex = dockablePane.SelectedIndex;
//remove contents from container pane and insert in hosted pane
while (dockablePane.Items.Count > 0)
{
ManagedContent content = dockablePane.RemoveContent(0);
//add content to my temporary pane
pane.Items.Add(content);
}
//let templates access this pane
HostedPane = pane;
HostedPane.SelectedIndex = selectedIndex;
//Change state on contents
IsDockableWindow = true;
}