本文整理汇总了C#中System.Windows.UIElement.GetUIParentNo3DTraversal方法的典型用法代码示例。如果您正苦于以下问题:C# UIElement.GetUIParentNo3DTraversal方法的具体用法?C# UIElement.GetUIParentNo3DTraversal怎么用?C# UIElement.GetUIParentNo3DTraversal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.UIElement
的用法示例。
在下文中一共展示了UIElement.GetUIParentNo3DTraversal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: markTreeDirty
private void markTreeDirty(UIElement e)
{
//walk up until we are the topmost UIElement in the tree.
while(true)
{
UIElement p = e.GetUIParentNo3DTraversal() as UIElement;
if(p == null) break;
e = p;
}
markTreeDirtyHelper(e);
MeasureQueue.Add(e);
ArrangeQueue.Add(e);
}
示例2: getProperArrangeRect
private Rect getProperArrangeRect(UIElement element)
{
Rect arrangeRect = element.PreviousArrangeRect;
// ELements without a parent (top level) get Arrange at DesiredSize
// if they were measured "to content" (as infinity indicates).
// If we arrange the element that is temporarily disconnected
// so it is not a top-level one, the assumption is that it will be
// layout-invalidated and/or recomputed by the parent when reconnected.
if (element.GetUIParentNo3DTraversal() == null)
{
arrangeRect.X = arrangeRect.Y = 0;
if (double.IsPositiveInfinity(element.PreviousConstraint.Width))
arrangeRect.Width = element.DesiredSize.Width;
if (double.IsPositiveInfinity(element.PreviousConstraint.Height))
arrangeRect.Height = element.DesiredSize.Height;
}
return arrangeRect;
}