本文整理汇总了C#中System.Windows.UIElement.UpdateLayout方法的典型用法代码示例。如果您正苦于以下问题:C# UIElement.UpdateLayout方法的具体用法?C# UIElement.UpdateLayout怎么用?C# UIElement.UpdateLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.UIElement
的用法示例。
在下文中一共展示了UIElement.UpdateLayout方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Forward
// Forward to the next element
private void Forward(UIElement element, bool click)
{
Detach();
if (click)
{
//element.RaiseEvent(new RoutedEventArgs(Button.ClickEvent, null));
var control = element as IKeyTipedControl;
if (control != null) control.OnKeyTipPressed();
element.UpdateLayout();
}
var children = LogicalTreeHelper.GetChildren(element)
.Cast<object>()
.Where(x => x is UIElement)
.Cast<UIElement>().ToArray();
if (children.Length == 0) { Terminate(); return; }
childAdorner = GetTopLevelElement(children[0]) != GetTopLevelElement(element) ?
new KeyTipAdorner(children[0], element, this) :
new KeyTipAdorner(element, element, this);
Detach();
childAdorner.Attach();
}
示例2: ToImage
private async Task ToImage(UIElement element)
{
element.Measure(new Size(480, 800));
element.Arrange(new Rect{ Height = 800, Width = 480});
element.UpdateLayout();
var bitmap = new WriteableBitmap(480, 800);
bitmap.Render(element, null);
bitmap.Invalidate();
await SaveTheImage(bitmap);
}
示例3: ToImage
private async Task ToImage(UIElement element, double width, double height)
{
element.Measure(new Size(width, height));
element.Arrange(new Rect { Height = height, Width = width });
element.UpdateLayout();
var bitmap = new WriteableBitmap((int)width, (int)height);
bitmap.Render(element, null);
bitmap.Invalidate();
await SaveTheImage(bitmap, WideTileUrl);
}
示例4: UpdateLayoutAndDoEvents
public static void UpdateLayoutAndDoEvents(UIElement element, DispatcherPriority priority) {
element.UpdateLayout();
DoEvents(priority);
}