UIElement.IsMeasureValid UIElement.IsMeasureValid UIElement.IsMeasureValid UIElement.IsMeasureValid Property


取得值,這個值表示配置測量所傳回的目前大小是否有效。Gets a value indicating whether the current size returned by layout measure is valid.

 property bool IsMeasureValid { bool get(); };
public bool IsMeasureValid { get; }
member this.IsMeasureValid : bool
Public ReadOnly Property IsMeasureValid As Boolean


如果配置的測量傳遞傳回有效的目前值則為 true,否則為 falsetrue if the measure pass of layout returned a valid and current value; otherwise, false.


您可以強制測量和排列方式是藉由呼叫即將失效InvalidateMeasure這個項目 (或在視覺樹狀結構的任何父項目)。You can force measurement and arrangement to be invalidated by calling InvalidateMeasure on this element (or any parent element up the visual tree). 這會指定配置重新撰寫以非同步的方式,取決於配置系統一次發生。This designates the layout for recomposition asynchronously, occurring at a time determined by the layout system. 或者,您可以在這裡進行的立即呼叫UpdateLayoutAlternatively, you could make an immediate call to UpdateLayout. 不過,您應該只呼叫UpdateLayout如果很可能沒有進一步的失效是暫止 (大量不必要地強制更新會有影響效能)。However, you should only call UpdateLayout if it is likely that no further invalidations are pending (a large number of unnecessarily forced updates will have performance consequences).

如果IsMeasureValidfalseIsArrangeValid也必須是false(版面配置程序,強制執行邏輯,排列方式不能有效而不需要先在 有效的度量單位)。If IsMeasureValid is false, IsArrangeValid must also be false (by the enforced logic of the layout process, arrangement cannot be valid without measurement first being valid).