DirectPropertyTOwner, TValueAddOwnerTNewOwner Method
Registers the direct property on another type.
Namespace: AvaloniaAssembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
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
- getter FuncTNewOwner, TValue
- Gets the current value of the property.
- setter ActionTNewOwner, TValue (Optional)
- Sets the value of the property.
- unsetValue TValue (Optional)
-
The value to use when the property is set to UnsetValue
- defaultBindingMode BindingMode (Optional)
- The default binding mode for the property.
- enableDataValidation Boolean (Optional)
-
Whether the property is interested in data validation.
- TNewOwner
- The type of the additional owner.
DirectPropertyTNewOwner,
TValueThe property.