Skip to main content

DirectProperty<TOwner, TValue> Class

Definition

Namespace:Avalonia
Assembly:Avalonia.Base
Package:Avalonia

A direct avalonia property.

public class DirectProperty<TOwner, TValue>

Inheritance: DirectPropertyBase<<T>> -> DirectProperty<TOwner, TValue>

Implements: IDirectPropertyAccessor

Remarks

Direct avalonia properties are backed by a field on the object, but exposed via the Avalonia.AvaloniaProperty system. They hold a getter and an optional setter which allows the avalonia property system to read and write the current value.

Methods

NameDescription
AddOwnerNo summary available.

AddOwner Method

public Avalonia.DirectProperty<TOwner,TValue><TNewOwner, TValue> AddOwner<TNewOwner>(Func<TNewOwner, TValue> getter, Action<TNewOwner, TValue> setter, TValue unsetValue, Avalonia.Data.BindingMode defaultBindingMode, bool enableDataValidation)

Parameters

getter Func<TNewOwner, TValue>

setter Action<TNewOwner, TValue>

unsetValue TValue

defaultBindingMode Avalonia.Data.BindingMode

enableDataValidation bool

Type Parameters

TNewOwner

Returns

Avalonia.DirectProperty<TOwner,TValue><TNewOwner, TValue>

Properties

NameDescription
GetterGets the getter function.
SetterGets the setter function.

Getter Property

Gets the getter function.

public Func<TOwner, TValue> Getter { get; set; }

Setter Property

Gets the setter function.

public Action<TOwner, TValue> Setter { get; set; }