UIElement::Measure Method (Size)
Updates the DesiredSize of a UIElement. Parent elements call this method from their own MeasureCore implementations to form a recursive layout update. Calling this method constitutes the first pass (the "Measure" pass) of a layout update.
Assembly: PresentationCore (in PresentationCore.dll)
The available space that a parent element can allocate a child element. A child element can request a larger space than what is available; the provided size might be accommodated if scrolling is possible in the content model for the current element.
Computation of layout positioning in Windows Presentation Foundation (WPF) is comprised of a Arrange call. During the call, an element determines its size requirements by using an availableSize input. During the Arrange call, the element size is finalized.call and an
availableSize can be any number from zero to infinite. Elements participating in layout should return the minimum Size they require for a given availableSize.
When a layout is first instantiated, it always receives a Arrange. However, after the first layout pass, it may receive an Arrange call without a ; this can happen when a property that affects only Arrange is changed (such as alignment), or when the parent receives an Arrange without a . A call will automatically invalidate an Arrange call.call before
Layout updates happen asynchronously, such that the main thread is not waiting for every possible layout change. Querying an element via code-behind checking of property values may not immediately reflect changes to properties that interact with the sizing or layout characteristics (the Width property, for example).
Layout updates can be forced by using the UpdateLayout method. However, calling this method is usually unnecessary and can cause poor performance.
The layout system keeps two separate queues of invalid layouts, one for Arrange. The layout queue is sorted based upon the order of elements in the visual tree of the element performing layout; elements higher in the tree are at the top of the queue, to avoid redundant layouts caused by repeated changes in parents. Duplicate entries are automatically removed from the queue, and elements are automatically removed from the queue if they are already layout-validated.and one for
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0