FrameworkElement.SizeChanged 事件

定義

當這個項目的 ActualHeightActualWidth 屬性變更值時發生。Occurs when either the ActualHeight or the ActualWidth properties change value on this element.

public:
 event System::Windows::SizeChangedEventHandler ^ SizeChanged;
public event System.Windows.SizeChangedEventHandler SizeChanged;
member this.SizeChanged : System.Windows.SizeChangedEventHandler 
Public Custom Event SizeChanged As SizeChangedEventHandler 

備註

直接路由事件不會遵循路由,只會在引發它們的相同專案中處理。Direct routed events do not follow a route, they are only handled within the same element on which they are raised. 直接路由事件支援其他路由事件行為:它們支援可存取的處理常式集合,而且可以用來做為樣式中的 EventTriggerDirect routed events do support other routed event behavior: they support an accessible handlers collection, and can be used as an EventTrigger in a style.

版面配置系統會讀取此事件之 SizeChangedEventArgs 引數類別內的屬性,以判斷是否應該將報告的大小變更視為重要。The layout system reads properties within the SizeChangedEventArgs argument class of this event, to determine whether the reported size changes should be considered significant. 這可讓版面配置系統或您的控制項專屬版面配置執行,避免因為在新舊高度或寬度值之間以視覺方式 imperceptible 差異而強制進行版面配置變更。This allows the layout system or your control-specific layout implementations to avoid forcing a layout change due to visually imperceptible differences between old and new height or width values. Imperceptible 差異可能是因為浮點資料類型的進位或相同結果計算所造成。The imperceptible differences might be due to rounding or same-result calculations of a floating-point data types.

路由事件資訊Routed Event Information

識別碼欄位Identifier field SizeChangedEvent
路由策略Routing strategy 直接Direct
Delegate - 委派Delegate SizeChangedEventHandler

適用於

另請參閱