本文整理汇总了C#中System.Windows.Media.Visual.GetRenderElement方法的典型用法代码示例。如果您正苦于以下问题:C# Visual.GetRenderElement方法的具体用法?C# Visual.GetRenderElement怎么用?C# Visual.GetRenderElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Visual
的用法示例。
在下文中一共展示了Visual.GetRenderElement方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveVisualChild
public void RemoveVisualChild(Visual child)
{
if (child.VisualParent != this)
{
return;
}
visualChildren.Remove(child);
child.VisualParent = null;
foreach (IRenderElementFactory factory in visualRenderElements.Keys)
{
visualRenderElements[factory].RemoveChild(child.GetRenderElement(factory));
}
}
示例2: SetVisualChildIndex
public void SetVisualChildIndex(Visual child, int newIndex)
{
int oldIndex = visualChildren.IndexOf(child);
if (oldIndex == -1 || oldIndex == newIndex)
{
return;
}
visualChildren.Remove(child);
visualChildren.Insert(newIndex, child);
foreach (IRenderElementFactory factory in visualRenderElements.Keys)
{
object childRenderElement = child.GetRenderElement(factory);
visualRenderElements[factory].RemoveChild(childRenderElement);
visualRenderElements[factory].InsertChild(newIndex, childRenderElement);
}
}
示例3: AddVisualChild
public void AddVisualChild(Visual child)
{
if (child.VisualParent == this)
{
return;
}
if (child.VisualParent != null)
{
child.VisualParent.RemoveVisualChild(child);
}
child.VisualParent = this;
visualChildren.Add(child);
int renderChildIndex = containsContentRenderElement ? visualChildren.Count : visualChildren.Count - 1;
foreach (IRenderElementFactory factory in visualRenderElements.Keys)
{
visualRenderElements[factory].InsertChild(renderChildIndex, child.GetRenderElement(factory));
}
}