Skip to main content

SizeChangedEventArgs Class

Definition

Assembly:Avalonia.Controls
Package:Avalonia

Provides data specific to a SizeChanged event.

public class SizeChangedEventArgs

Inheritance: EventArgs -> RoutedEventArgs -> SizeChangedEventArgs

Constructors

NameDescription
SizeChangedEventArgs (3 overloads)Initializes a new instance of the Avalonia.Controls.SizeChangedEventArgs class.

SizeChangedEventArgs overloads

SizeChangedEventArgs Constructor

Initializes a new instance of the Avalonia.Controls.SizeChangedEventArgs class.

public SizeChangedEventArgs(Avalonia.Interactivity.RoutedEvent routedEvent)
Parameters

routedEvent Avalonia.Interactivity.RoutedEvent

The routed event associated with these event args.

SizeChangedEventArgs Constructor

Initializes a new instance of the Avalonia.Controls.SizeChangedEventArgs class.

public SizeChangedEventArgs(Avalonia.Interactivity.RoutedEvent routedEvent, object source)
Parameters

routedEvent Avalonia.Interactivity.RoutedEvent

The routed event associated with these event args.

source object

The source object that raised the routed event.

SizeChangedEventArgs Constructor

Initializes a new instance of the Avalonia.Controls.SizeChangedEventArgs class.

public SizeChangedEventArgs(Avalonia.Interactivity.RoutedEvent routedEvent, object source, Avalonia.Size previousSize, Avalonia.Size newSize)
Parameters

routedEvent Avalonia.Interactivity.RoutedEvent

The routed event associated with these event args.

source object

The source object that raised the routed event.

previousSize Avalonia.Size

The previous size (or bounds) of the object.

newSize Avalonia.Size

The new size (or bounds) of the object.

Properties

NameDescription
HeightChangedGets a value indicating whether the height of the new size is considered different than the previous size height.
NewSizeGets the new size (or bounds) of the object.
PreviousSizeGets the previous size (or bounds) of the object.
WidthChangedGets a value indicating whether the width of the new size is considered different than the previous size width.
HandledGets or sets a value indicating whether the routed event has already been handled. Inherited from RoutedEventArgs.
RouteGets or sets the routing strategy (direct, bubbling, or tunneling) of the routed event. Inherited from RoutedEventArgs.
RoutedEventGets or sets the routed event associated with these event args. Inherited from RoutedEventArgs.
SourceGets or sets the source object that raised the routed event. Inherited from RoutedEventArgs.

HeightChanged Property

Gets a value indicating whether the height of the new size is considered different than the previous size height.

public bool HeightChanged { get; set; }

Remarks

This will take into account layout epsilon and will not be true if both heights are considered equivalent for layout purposes. Remember there can be small variations in the calculations between layout cycles due to rounding and precision even when the size has not otherwise changed.

NewSize Property

Gets the new size (or bounds) of the object.

public Avalonia.Size NewSize { get; set; }

PreviousSize Property

Gets the previous size (or bounds) of the object.

public Avalonia.Size PreviousSize { get; set; }

WidthChanged Property

Gets a value indicating whether the width of the new size is considered different than the previous size width.

public bool WidthChanged { get; set; }

Remarks

This will take into account layout epsilon and will not be true if both widths are considered equivalent for layout purposes. Remember there can be small variations in the calculations between layout cycles due to rounding and precision even when the size has not otherwise changed.