AvaloniaProperty.

RegisterDirect<TOwner, TValue>(string, Func<TOwner, TValue>, Action<TOwner, TValue>, TValue, BindingMode, bool) Method

Summary

Registers a direct AvaloniaProperty.
Namespace
Avalonia
Containing Type
AvaloniaProperty

Syntax

public static DirectProperty<TOwner, TValue> RegisterDirect<TOwner, TValue>(string name, Func<TOwner, TValue> getter, Action<TOwner, TValue> setter = null, TValue unsetValue = default(TValue), BindingMode defaultBindingMode = OneWay, bool enableDataValidation = false) 
    where TOwner : IAvaloniaObject

Type Parameters

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

Parameters

Name Type Description
name string The name of the property.
getter Func<TOwner, TValue> Gets the current value of the property.
setter Action<TOwner, TValue> Sets the value of the property.
unsetValue TValue The value to use when the property is cleared.
defaultBindingMode BindingMode The default binding mode for the property.
enableDataValidation bool Whether the property is interested in data validation.

Return Value

Type Description
DirectProperty<TOwner, TValue> A AvaloniaProperty<TValue>