AvaloniaPropertyRegisterDirectTOwner, TValue Method

Registers a direct AvaloniaProperty.

Definition

Namespace: Avalonia
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public static DirectProperty<TOwner, TValue> RegisterDirect<TOwner, TValue>(
	string name,
	Func<TOwner, TValue> getter,
	Action<TOwner, TValue>? setter = null,
	TValue unsetValue = null,
	BindingMode defaultBindingMode = BindingMode.OneWay,
	bool enableDataValidation = false
)
where TOwner : AvaloniaObject

Parameters

name  String
The name of the property.
getter  FuncTOwner, TValue
Gets the current value of the property.
setter  ActionTOwner, TValue  (Optional)
Sets the value of the property.
unsetValue  TValue  (Optional)
The value to use when the property is cleared.
defaultBindingMode  BindingMode  (Optional)
The default binding mode for the property.
enableDataValidation  Boolean  (Optional)
Whether the property is interested in data validation.

Type Parameters

TOwner
The type of the class that is registering the property.
TValue
The type of the property's value.

Return Value

DirectPropertyTOwner, TValue
A AvaloniaPropertyTValue

See Also