UIElement.InvalidateVisual
Invalidates the rendering of the element, and forces a complete new layout pass. OnRender(DrawingContext) is called after the layout cycle is completed.
使元素的呈现失效,并强制执行完整的新布局处理过程。 完成布局循环后调用 OnRender(DrawingContext)。
Remarks
This method calls InvalidateArrange internally.
This method is not generally called from your application code. The WPF framework-level layout system does its own handling of changes in the visual tree of an element, and would be calling the equivalent of this method when necessary already. Calling this method is necessary only for advanced scenarios. One such advanced scenario 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 layout when it changes.
注解
此方法 InvalidateArrange 在内部调用。
通常不会从应用程序代码中调用此方法。 WPF 框架级别布局系统自行处理元素的可视化树中的更改,并在必要时调用此方法的等效项。 只有高级方案才需要调用此方法。 一个这样的高级方案是,如果您要 PropertyChangedCallback 为不在或派生类上的依赖属性创建, Freezable FrameworkElement 但在更改时仍会影响布局。