RegisterAttached<TOwner, THost, TValue>(String, TValue, Boolean, BindingMode, Func<TValue, Boolean>, Func<AvaloniaObject, TValue, TValue>) Method
Registers an attached AvaloniaProperty.
Definition
Namespace: Avalonia
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public static AttachedProperty<TValue> RegisterAttached<TOwner, THost, TValue>(
string name,
TValue defaultValue = null,
bool inherits = false,
BindingMode defaultBindingMode = BindingMode.OneWay,
Func<TValue, bool>? validate = null,
Func<AvaloniaObject, TValue, TValue>? coerce = null
)
where THost : AvaloniaObject
Public Shared Function RegisterAttached(Of TOwner, THost As AvaloniaObject, TValue) (
name As String,
Optional defaultValue As TValue = Nothing,
Optional inherits As Boolean = false,
Optional defaultBindingMode As BindingMode = BindingMode.OneWay,
Optional validate As Func(Of TValue, Boolean) = Nothing,
Optional coerce As Func(Of AvaloniaObject, TValue, TValue) = Nothing
) As AttachedProperty(Of TValue)
static member RegisterAttached :
name : string *
?defaultValue : 'TValue *
?inherits : bool *
?defaultBindingMode : BindingMode *
?validate : Func<'TValue, bool> *
?coerce : Func<AvaloniaObject, 'TValue, 'TValue>
(* Defaults:
let _defaultValue = defaultArg defaultValue null
let _inherits = defaultArg inherits false
let _defaultBindingMode = defaultArg defaultBindingMode BindingMode.OneWay
let _validate = defaultArg validate null
let _coerce = defaultArg coerce null
*)
-> AttachedProperty<'TValue> when 'THost : AvaloniaObject
Parameters
- String
- The name of the property.
- TValue (Optional)
- The default value of the property.
- Boolean (Optional)
- Whether the property inherits its value.
- BindingMode (Optional)
- The default binding mode for the property.
- Func(TValue, Boolean) (Optional)
- A value validation callback.
- Func(AvaloniaObject, TValue, TValue) (Optional)
- A value coercion callback.
Type Parameters
- The type of the class that is registering the property.
- The type of the class that the property is to be registered on.
- The type of the property's value.
Return Value
AttachedProperty(TValue)
A AvaloniaProperty(TValue)
See Also
Reference
AvaloniaProperty Class
RegisterAttached Overload
Avalonia Namespace