本文整理汇总了C#中Crownwood.Magic.Docking.Content.ContentBecomesFloating方法的典型用法代码示例。如果您正苦于以下问题:C# Content.ContentBecomesFloating方法的具体用法?C# Content.ContentBecomesFloating怎么用?C# Content.ContentBecomesFloating使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Crownwood.Magic.Docking.Content
的用法示例。
在下文中一共展示了Content.ContentBecomesFloating方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InsertContentIntoWindowContent
public WindowContent InsertContentIntoWindowContent(int pos, Content c, WindowContent wc)
{
// Validate the incoming Content instance is a valid reference
// and is a current instance within our internal collection
if ((c == null) || !_contents.Contains(c))
return null;
// Validate the incoming WindowContent instance is a valid reference
if (wc == null)
return null;
// Is Content already part of given Window then nothing to do
if (c.ParentWindowContent == wc)
return wc;
else
{
bool valid = true;
// Do not generate hiding/hidden/shown events
_surpressVisibleEvents++;
// Manageing Zones should remove display AutoHide windows
RemoveShowingAutoHideWindows();
if (c.ParentWindowContent != null)
{
// Is there a change in docking state?
if (c.ParentWindowContent.ParentZone.State != wc.ParentZone.State)
{
// If it used to be in a floating mode, then record state change
if (c.ParentWindowContent.ParentZone.State == State.Floating)
c.ContentLeavesFloating();
else
c.ContentBecomesFloating();
}
// Remove the Content from its current WindowContent
c.ParentWindowContent.Contents.Remove(c);
}
else
{
// If a window content is in AutoHide then it will not have a parent zone
if (wc.ParentZone != null)
{
// If adding to a floating window then it is not docked
if (wc.ParentZone.State == State.Floating)
c.Docked = false;
}
else
{
// Cannot dynamically add into an autohide parent
valid = false;
}
}
if (valid)
{
// Add the existing Content to this instance
wc.Contents.Insert(pos, c);
}
// Enable generation hiding/hidden/shown events
_surpressVisibleEvents--;
if (valid)
{
// Generate event to indicate content is now visible
OnContentShown(c);
}
return wc;
}
}
示例2: AddContentToZone
public Window AddContentToZone(Content c, Zone z, int index)
{
// Validate the incoming Content instance is a valid reference
// and is a current instance within our internal collection
if ((c == null) || !_contents.Contains(c))
return null;
// Validate the incoming Zone instance is a valid reference
if (z == null)
return null;
// Do not generate hiding/hidden/shown events
_surpressVisibleEvents++;
// Manageing Zones should remove display AutoHide windows
RemoveShowingAutoHideWindows();
// Is the window already part of a WindowContent?
if (c.ParentWindowContent != null)
{
// Is there a change in docking state?
if (c.ParentWindowContent.ParentZone.State != z.State)
{
// If it used to be in a floating mode, then record state change
if (c.ParentWindowContent.ParentZone.State == State.Floating)
c.ContentLeavesFloating();
else
c.ContentBecomesFloating();
}
// Remove the Content from its current WindowContent
c.ParentWindowContent.Contents.Remove(c);
}
else
{
// If target zone is floating window then we are no longer docked
if (z.State == State.Floating)
c.Docked = false;
}
// Create a new WindowContent instance according to our style
Window w = CreateWindowForContent(c);
// Add the Window to the Zone at given position
z.Windows.Insert(index, w);
// Enable generation hiding/hidden/shown events
_surpressVisibleEvents--;
// Generate event to indicate content is now visible
OnContentShown(c);
return w;
}