Occurs when the layout of the visual tree changes.
Syntax
<frameworkElement LayoutUpdated="eventhandler"/>
Event information
| Delegate | System.EventHandler<Object> [.NET] | Windows.Foundation.EventHandler<Object> [C++] |
|---|
Remarks
LayoutUpdated is the last object lifetime event to occur in the XAML load sequence before a control is ready for interaction. However, LayoutUpdated can also occur at run time during the object lifetime, for a variety of reasons: a property change, a window resizing, or an explicit request (UpdateLayout or a changed control template). The LayoutUpdated event is raised after all SizeChanged events in the tree have been raised.
LayoutUpdated can occur when the object where the handler is attached does not necessarily change anything in the visual tree under it. For instance, imagine a layout container where there are two elements. If the first object changes a property that forces a new layout, both objects raise LayoutUpdated because the second object might be repositioned even if its own subsidiary layout does not change.
When you handle LayoutUpdated, do not rely on the sender value. For LayoutUpdated, sender is always null, regardless of where the handler is attached. This is to prevent handlers from assigning any meaning to sender, such as implying that it was that specific element that raised the event out of the visual tree. Rather, LayoutUpdated implies that something in the overall visual tree has changed, and each specific object anywhere in the tree has the option of handling this occurrence.
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 1/31/2013