AvaloniaProperty.

RegisterAttached<TOwner, THost, TValue>(string, TValue, bool, BindingMode, Func<TValue, bool>, Func<IAvaloniaObject, TValue, TValue>) Method

Summary

Registers an attached AvaloniaProperty.
Namespace
Avalonia
Containing Type
AvaloniaProperty

Syntax

public static AttachedProperty<TValue> RegisterAttached<TOwner, THost, TValue>(string name, TValue defaultValue = default(TValue), bool inherits = false, BindingMode defaultBindingMode = OneWay, Func<TValue, bool> validate = null, Func<IAvaloniaObject, TValue, TValue> coerce = null) 
    where THost : IAvaloniaObject

Type Parameters

Name Description
TOwner The type of the class that is registering the property.
THost The type of the class that the property is to be registered on.
TValue The type of the property's value.

Parameters

Name Type Description
name string The name of the property.
defaultValue TValue The default value of the property.
inherits bool Whether the property inherits its value.
defaultBindingMode BindingMode The default binding mode for the property.
validate Func<TValue, bool> A value validation callback.
coerce Func<IAvaloniaObject, TValue, TValue> A value coercion callback.

Return Value

Type Description
AttachedProperty<TValue> A AvaloniaProperty<TValue>