SizeChangedEventArgs Class
Definition
Provides data related to the FrameworkElement.SizeChanged event.
Equivalent WinUI class: Microsoft.UI.Xaml.SizeChangedEventArgs.
public ref class SizeChangedEventArgs sealed : RoutedEventArgs
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
class SizeChangedEventArgs sealed : RoutedEventArgs
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
public sealed class SizeChangedEventArgs : RoutedEventArgs
Public NotInheritable Class SizeChangedEventArgs
Inherits RoutedEventArgs
- Inheritance
- Attributes
Windows 10 requirements
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
Remarks
The PreviousSize value is based on ActualHeight and ActualWidth values on the element before the layout change that motivated the SizeChanged event. The NewSize value is based on the ActualHeight and ActualWidth values after the layout change is processed.
There's another event named SizeChanged that's defined by the Window class. Event handlers for Window.SizeChanged use the WindowSizeChangedEventArgs class for data. Window.SizeChanged can occur in some of the same circumstances that FrameworkElement.SizeChanged occurs; for more info, see FrameworkElement.SizeChanged.
Properties
NewSize |
Gets the new size of the object reporting the size change. Equivalent WinUI property: Microsoft.UI.Xaml.SizeChangedEventArgs.NewSize. |
OriginalSource |
Gets a reference to the object that raised the event. This is often a template part of a control rather than an element that was declared in your app UI. Equivalent WinUI property: Microsoft.UI.Xaml.RoutedEventArgs.OriginalSource. (Inherited from RoutedEventArgs) |
PreviousSize |
Gets the previous size of the object reporting the size change. Equivalent WinUI property: Microsoft.UI.Xaml.SizeChangedEventArgs.PreviousSize. |