Skip to main content

SetAndRaise<T> Method

Sets the backing field for a direct avalonia property, raising the PropertyChanged event if the value has changed.

Definition​

Namespace: Avalonia
Assembly: Avalonia.Base (in Avalonia.Base.dll)

protected bool SetAndRaise<T>(
DirectPropertyBase<T> property,
ref T field,
T value
)

Parameters​

  DirectPropertyBase(T)
The property.
  T
The backing field.
  T
The value.

Type Parameters​

The type of the property.

Return Value​

Boolean
True if the value changed, otherwise false.

See Also​

Reference​

AvaloniaObject Class
Avalonia Namespace