AddOwner<TNewOwner> Method
Registers the direct property on another type.
Definition
Namespace: Avalonia
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public DirectProperty<TNewOwner, TValue> AddOwner<TNewOwner>(
Func<TNewOwner, TValue> getter,
Action<TNewOwner, TValue>? setter = null,
TValue unsetValue = null,
BindingMode defaultBindingMode = BindingMode.Default,
bool enableDataValidation = false
)
where TNewOwner : AvaloniaObject
Public Function AddOwner(Of TNewOwner As AvaloniaObject) (
getter As Func(Of TNewOwner, TValue),
Optional setter As Action(Of TNewOwner, TValue) = Nothing,
Optional unsetValue As TValue = Nothing,
Optional defaultBindingMode As BindingMode = BindingMode.Default,
Optional enableDataValidation As Boolean = false
) As DirectProperty(Of TNewOwner, TValue)
member AddOwner :
getter : Func<'TNewOwner, 'TValue> *
?setter : Action<'TNewOwner, 'TValue> *
?unsetValue : 'TValue *
?defaultBindingMode : BindingMode *
?enableDataValidation : bool
(* Defaults:
let _setter = defaultArg setter null
let _unsetValue = defaultArg unsetValue null
let _defaultBindingMode = defaultArg defaultBindingMode BindingMode.Default
let _enableDataValidation = defaultArg enableDataValidation false
*)
-> DirectProperty<'TNewOwner, 'TValue> when 'TNewOwner : AvaloniaObject
Parameters
- Func(TNewOwner, TValue)
- Gets the current value of the property.
- Action(TNewOwner, TValue) (Optional)
- Sets the value of the property.
- TValue (Optional)
- The value to use when the property is set to UnsetValue
- 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 additional owner.
Return Value
DirectProperty(TNewOwner, TValue)
The property.