Skip to main content

AddOwner<TNewOwner> Method

Registers the direct property on another type.

Definition

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

public DirectProperty<TNewOwner, TValue> AddOwner<TNewOwner>(
Func<TNewOwner, TValue> getter,
Action<TNewOwner, TValue>? setter = null,
TValue unsetValue = null,
BindingMode defaultBindingMode = BindingMode.Default,
bool enableDataValidation = false
)
where TNewOwner : AvaloniaObject

Parameters

  Func(TNewOwner, TValue)
Gets the current value of the property.
  Action(TNewOwner, TValue)  (Optional)
Sets the value of the property.
  TValue  (Optional)
The value to use when the property is set to UnsetValue
  BindingMode  (Optional)
The default binding mode for the property.
  Boolean  (Optional)
Whether the property is interested in data validation.

Type Parameters

The type of the additional owner.

Return Value

DirectProperty(TNewOwner, TValue)
The property.

See Also

Reference

DirectProperty(TOwner, TValue) Class
Avalonia Namespace