DirectProperty<TOwner, TValue> Class

Summary

A direct avalonia property.
Namespace
Avalonia
Interfaces
Base Types
graph BT Type-->Base0["DirectPropertyBase<TValue>"] Base0-->Base1["AvaloniaProperty<TValue>"] Base1-->Base2["AvaloniaProperty"] click Base2 "/api/Avalonia/AvaloniaProperty" Base2-->Base3["object"] Type-.->Interface0["IEquatable<AvaloniaProperty>"] Type-.->Interface1["IPropertyInfo"] click Interface1 "/api/Avalonia.Data.Core/IPropertyInfo" Type-.->Interface2["IDirectPropertyAccessor"] Type["DirectProperty<TOwner, TValue>"] class Type type-node

Syntax

public class DirectProperty<TOwner, TValue> : DirectPropertyBase<TValue>, 
    IEquatable<AvaloniaProperty>, IPropertyInfo, IDirectPropertyAccessor
    where TOwner : IAvaloniaObject

Remarks

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

Type Parameters

Name Description
TOwner The class that registered the property.
TValue The type of the property's value.

Constructors

Fields

Name Constant Value Summary
UnsetValue
Represents an unset property value.
Inherited from AvaloniaProperty
static

Properties

Name Value Summary
Changed IObservable<AvaloniaPropertyChangedEventArgs>
Gets an observable that is fired when this property changes on any AvaloniaObject instance.
Inherited from AvaloniaProperty
Getter Func<TOwner, TValue>
Gets the getter function.
Inherits bool
Gets a value indicating whether the property inherits its value.
Inherited from AvaloniaProperty
IsAttached bool
Gets a value indicating whether this is an attached property.
Inherited from AvaloniaProperty
IsDirect bool
Gets a value indicating whether this is a direct property.
IsReadOnly bool
Gets a value indicating whether this is a readonly property.
Name string
Gets the name of the property.
Inherited from AvaloniaProperty
Notifying Action<IAvaloniaObject, bool>
Gets a method that gets called before and after the property starts being notified on an object.
Inherited from AvaloniaProperty
Owner Type
Gets the type that registered the property.
OwnerType Type
Gets the type of the class that registered the property.
Inherited from AvaloniaProperty
PropertyType Type
Gets the type of the property's value.
Inherited from AvaloniaProperty
Setter Action<TOwner, TValue>
Gets the setter function.

Methods

Name Value Summary
AddOwner<TNewOwner>(Func<TNewOwner, TValue>, Action<TNewOwner, TValue>, TValue, BindingMode, bool) DirectProperty<TNewOwner, TValue>
Registers the direct property on another type.
AddOwnerWithDataValidation<TNewOwner>(Func<TNewOwner, TValue>, Action<TNewOwner, TValue>, TValue, BindingMode, bool) DirectProperty<TNewOwner, TValue>
Registers the direct property on another type.
Bind() IndexerDescriptor
Returns a binding accessor that can be passed to AvaloniaObject's [] operator to initiate a binding.
Inherited from AvaloniaProperty
Equals(AvaloniaProperty) bool
Inherited from AvaloniaProperty
Equals(object) bool
Inherited from AvaloniaProperty
GetHashCode() int
Inherited from AvaloniaProperty
GetMetadata(Type) AvaloniaPropertyMetadata
Gets the property metadata for the specified type.
Inherited from AvaloniaProperty
GetMetadata<T>() AvaloniaPropertyMetadata
Gets the property metadata for the specified type.
Inherited from AvaloniaProperty
IsValidValue(object) bool
Checks whether the value is valid for the property.
Inherited from AvaloniaProperty
OverrideMetadata(Type, AvaloniaPropertyMetadata) void
Overrides the metadata for the property on the specified type.
Inherited from AvaloniaProperty
Register<TOwner, TValue>(string, TValue, bool, BindingMode, Func<TValue, bool>, Func<IAvaloniaObject, TValue, TValue>, Action<IAvaloniaObject, bool>) StyledProperty<TValue>
Registers a AvaloniaProperty.
Inherited from AvaloniaProperty
static
RegisterAttached<THost, TValue>(string, Type, TValue, bool, BindingMode, Func<TValue, bool>, Func<IAvaloniaObject, TValue, TValue>) AttachedProperty<TValue>
Registers an attached AvaloniaProperty.
Inherited from AvaloniaProperty
static
RegisterAttached<TOwner, THost, TValue>(string, TValue, bool, BindingMode, Func<TValue, bool>, Func<IAvaloniaObject, TValue, TValue>) AttachedProperty<TValue>
Registers an attached AvaloniaProperty.
Inherited from AvaloniaProperty
static
RegisterDirect<TOwner, TValue>(string, Func<TOwner, TValue>, Action<TOwner, TValue>, TValue, BindingMode, bool) DirectProperty<TOwner, TValue>
Registers a direct AvaloniaProperty.
Inherited from AvaloniaProperty
static
ToString() string
Gets the string representation of the property.
Inherited from AvaloniaProperty

Operators

Name Value Summary
operator !(AvaloniaProperty) IndexerDescriptor
Inherited from AvaloniaProperty
operator !=(AvaloniaProperty, AvaloniaProperty) bool
Inherited from AvaloniaProperty
operator ~(AvaloniaProperty) IndexerDescriptor
Inherited from AvaloniaProperty
operator ==(AvaloniaProperty, AvaloniaProperty) bool
Inherited from AvaloniaProperty

Extension Methods

Name Value Summary
CanValueAffectRender() bool
Checks if values of given property can affect rendering (via IAffectsRender).