Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

UIElement.UpdateLayout Method

Ensures that all visual child elements of this element are properly updated for layout.

Namespace: System.Windows
Assembly: PresentationCore (in presentationcore.dll)

public:
void UpdateLayout ()
public void UpdateLayout ()
public function UpdateLayout ()
You cannot use methods in XAML.

When you call this method, elements with IsMeasureValidfalse or IsArrangeValidfalse will call element-specific MeasureCore and ArrangeCore methods, which forces layout update, and all computed sizes will be validated.

Calling this method has no effect if layout is unchanged, or if neither arrangement nor measurement state of a layout is invalid. However, if layout is invalid in either respect, the UpdateLayout call will redo the entire layout. Therefore, you should avoid calling UpdateLayout after each incremental and minor change in the element tree. The layout system will perform element layout in a deferred manner, using an algorithm that balances performance and currency, and with a weighting strategy to defer changes to roots until all child elements are valid. You should only call UpdateLayout if you absolutely need updated sizes and positions, and only after you are certain that all changes to properties that you control and that may affect layout are completed.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

Show:
© 2014 Microsoft