RegisterDirect<TOwner, TValue> Method
Registers a direct AvaloniaProperty.
Definition
Namespace: Avalonia
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
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
Public Shared Function RegisterDirect(Of TOwner As AvaloniaObject, TValue) (
name As String,
getter As Func(Of TOwner, TValue),
Optional setter As Action(Of TOwner, TValue) = Nothing,
Optional unsetValue As TValue = Nothing,
Optional defaultBindingMode As BindingMode = BindingMode.OneWay,
Optional enableDataValidation As Boolean = false
) As DirectProperty(Of TOwner, TValue)
static member RegisterDirect :
name : string *
getter : Func<'TOwner, 'TValue> *
?setter : Action<'TOwner, 'TValue> *
?unsetValue : 'TValue *
?defaultBindingMode : BindingMode *
?enableDataValidation : bool
(* Defaults:
let _setter = defaultArg setter null
let _unsetValue = defaultArg unsetValue null
let _defaultBindingMode = defaultArg defaultBindingMode BindingMode.OneWay
let _enableDataValidation = defaultArg enableDataValidation false
*)
-> DirectProperty<'TOwner, 'TValue> when 'TOwner : AvaloniaObject
Parameters
- String
- The name of the property.
- Func(TOwner, TValue)
- Gets the current value of the property.
- Action(TOwner, TValue) (Optional)
- Sets the value of the property.
- TValue (Optional)
- The value to use when the property is cleared.
- 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 class that is registering the property.
- The type of the property's value.
Return Value
DirectProperty(TOwner, TValue)
A AvaloniaProperty(TValue)