FrameworkElement.OnRenderSizeChanged(SizeChangedInfo) FrameworkElement.OnRenderSizeChanged(SizeChangedInfo) FrameworkElement.OnRenderSizeChanged(SizeChangedInfo) FrameworkElement.OnRenderSizeChanged(SizeChangedInfo) Method


使用指定的資訊作為最終事件資料的一部分,引發 SizeChanged 事件。Raises the SizeChanged event, using the specified information as part of the eventual event data.

protected public:
 override void OnRenderSizeChanged(System::Windows::SizeChangedInfo ^ sizeInfo);
protected internal override void OnRenderSizeChanged (System.Windows.SizeChangedInfo sizeInfo);
override this.OnRenderSizeChanged : System.Windows.SizeChangedInfo -> unit
Protected Friend Overrides Sub OnRenderSizeChanged (sizeInfo As SizeChangedInfo)


SizeChangedInfo SizeChangedInfo SizeChangedInfo SizeChangedInfo

變更所涉及之舊和新大小的詳細資料。Details of the old and new size involved in the change.


這個方法覆寫 OnRenderSizeChangedThis method overrides OnRenderSizeChanged. 如果您呼叫這個方法則會重設ActualWidth屬性,ActualHeight中提供的引數,變更的屬性,或兩者,根據為指定的項目,並且您總是會引發此事件。If you call this method you will reset the ActualWidth property, the ActualHeight property, or both, depending on what is specified as changed in the supplied arguments, and will you always raise the event.


不會覆寫這個方法的典型版面配置案例。Do not override this method for typical layout scenarios. 版面配置系統會刻意非同步的方式,以確保所有可能的配置排列,並說明量值的情況下運作。The layout system operates in a deliberately asynchronous way to assure that all possible layout arrange and measure cases are accounted for. 版面配置系統覆寫方法MeasureOverride(Size)ArrangeOverride(Size)通常已足夠完成任何必要的配置的自訂。The layout system override methods MeasureOverride(Size) and ArrangeOverride(Size) are usually sufficient for any required layout customization. OnRenderSizeChanged(SizeChangedInfo) 會公開為虛擬機器。OnRenderSizeChanged(SizeChangedInfo) is exposed as a virtual. 您可以覆寫OnRenderSizeChanged(SizeChangedInfo)更正執行階段行為的變更與輸入事件結合控制項的例外狀況的撰寫回應可能會提供不正確的版面配置資訊。You can override OnRenderSizeChanged(SizeChangedInfo) to correct for exceptional cases where a run-time behavioral change related to input events combined with control recomposition in response might give inaccurate layout information.

您可能仍會覆寫 (受保護但並未密封) 衍生類別中的,這個方法。You may still override this method in derived classes (it is protected but not sealed). 請務必呼叫基底實作,以保留先前所述,行為,除非您有非常特定的理由,停用預設 WPF 架構層級轉譯行為。Always call the base implementation to preserve the behavior mentioned above, unless you have very specific reasons for disabling default WPF framework-level rendering behavior. 無法引發SizeChanged事件將會產生非標準的版面配置行為,如果使用標準的 WPF 架構層級的版面配置系統實作。Failing to raise the SizeChanged event will cause non-standard layout behavior if using the standard WPF framework-level layout system implementation.