Table of Contents

Class SizeChangedEventArgs

Namespace
Avalonia.Controls
Assembly
Avalonia.Controls.dll

Provides data specific to a SizeChanged event.

public class SizeChangedEventArgs : RoutedEventArgs
Inheritance
SizeChangedEventArgs
Inherited Members

Constructors

SizeChangedEventArgs(RoutedEvent?)

Initializes a new instance of the SizeChangedEventArgs class.

public SizeChangedEventArgs(RoutedEvent? routedEvent)

Parameters

routedEvent RoutedEvent

The routed event associated with these event args.

SizeChangedEventArgs(RoutedEvent?, object?)

Initializes a new instance of the SizeChangedEventArgs class.

public SizeChangedEventArgs(RoutedEvent? routedEvent, object? source)

Parameters

routedEvent RoutedEvent

The routed event associated with these event args.

source object

The source object that raised the routed event.

SizeChangedEventArgs(RoutedEvent?, object?, Size, Size)

Initializes a new instance of the SizeChangedEventArgs class.

public SizeChangedEventArgs(RoutedEvent? routedEvent, object? source, Size previousSize, Size newSize)

Parameters

routedEvent RoutedEvent

The routed event associated with these event args.

source object

The source object that raised the routed event.

previousSize Size

The previous size (or bounds) of the object.

newSize Size

The new size (or bounds) of the object.

Properties

HeightChanged

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

public bool HeightChanged { get; }

Property Value

bool

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

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

public Size NewSize { get; init; }

Property Value

Size

PreviousSize

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

public Size PreviousSize { get; init; }

Property Value

Size

WidthChanged

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

public bool WidthChanged { get; }

Property Value

bool

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.