FrameworkElement.SizeChanged FrameworkElement.SizeChanged FrameworkElement.SizeChanged FrameworkElement.SizeChanged Event


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

 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. 直接路由的事件支援其他路由的事件的行為: 它們支援的可存取的處理常式集合,且可用來當做EventTrigger樣式。Direct 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. 這可讓版面配置系統或您的特定控制項版面配置實作,以避免強制版面配置變更,因為舊的和新的高度或寬度值之間以視覺化方式無法察覺的差異。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. 無法察覺的差異可能是因為浮點資料類型的捨入或相同結果的計算。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