UIElement.InvalidateArrange Method


使元素排列状态(布局)无效。Invalidates the arrange state (layout) for the element. 排列状态失效后,该元素将更新其布局,更新将以异步方式发生,除非随后由 UpdateLayout() 强制执行。After the invalidation, the element will have its layout updated, which will occur asynchronously unless subsequently forced by UpdateLayout().

 void InvalidateArrange();
public void InvalidateArrange ();
member this.InvalidateArrange : unit -> unit
Public Sub InvalidateArrange ()


频繁调用 InvalidateArrange 或特别是 UpdateLayout 会对性能产生重大影响。Frequent calls to InvalidateArrange or in particular to UpdateLayout have significant performance consequences. 因此,请避免调用此方法,除非你在对代码中的其他 Api 进行后续调用时绝对需要精确布局状态。Therefore, avoid calling this method unless you absolutely require precise layout state for subsequent calls to other APIs in your code. 如果要为不在 FreezableFrameworkElement 派生类上的依赖属性创建 PropertyChangedCallback,而该属性在更改时仍会影响布局的排列处理过程,则可以调用 InvalidateArrange 的高级方案。An advanced scenario where you might call InvalidateArrange is if you are creating a PropertyChangedCallback for a dependency property that is not on a Freezable or FrameworkElement derived class that still influences the arrange pass of layout when it changes.

Applies to