Class AvaloniaPropertyRegistry
- Namespace
- Avalonia
- Assembly
- Avalonia.Base.dll
Tracks registered AvaloniaProperty instances.
public class AvaloniaPropertyRegistry
- Inheritance
-
AvaloniaPropertyRegistry
- Inherited Members
Constructors
AvaloniaPropertyRegistry()
public AvaloniaPropertyRegistry()
Properties
Instance
Gets the AvaloniaPropertyRegistry instance
public static AvaloniaPropertyRegistry Instance { get; }
Property Value
Methods
FindRegistered(AvaloniaObject, string)
Finds a registered property on an object by name.
public AvaloniaProperty? FindRegistered(AvaloniaObject o, string name)
Parameters
o
AvaloniaObjectThe object.
name
stringThe property name.
Returns
- AvaloniaProperty
The registered property or null if no matching property found.
Exceptions
- InvalidOperationException
The property name contains a '.'.
FindRegistered(Type, string)
Finds a registered property on a type by name.
public AvaloniaProperty? FindRegistered(Type type, string name)
Parameters
Returns
- AvaloniaProperty
The registered property or null if no matching property found.
Exceptions
- InvalidOperationException
The property name contains a '.'.
FindRegisteredDirect<T>(AvaloniaObject, DirectPropertyBase<T>)
Finds a direct property as registered on an object.
public DirectPropertyBase<T>? FindRegisteredDirect<T>(AvaloniaObject o, DirectPropertyBase<T> property)
Parameters
o
AvaloniaObjectThe object.
property
DirectPropertyBase<T>The direct property.
Returns
- DirectPropertyBase<T>
The registered property or null if no matching property found.
Type Parameters
T
GetRegistered(AvaloniaObject)
Gets all AvaloniaPropertys registered on a object.
public IReadOnlyList<AvaloniaProperty> GetRegistered(AvaloniaObject o)
Parameters
o
AvaloniaObjectThe object.
Returns
- IReadOnlyList<AvaloniaProperty>
A collection of AvaloniaProperty definitions.
GetRegistered(Type)
Gets all non-attached AvaloniaPropertys registered on a type.
public IReadOnlyList<AvaloniaProperty> GetRegistered(Type type)
Parameters
type
TypeThe type.
Returns
- IReadOnlyList<AvaloniaProperty>
A collection of AvaloniaProperty definitions.
GetRegisteredAttached(Type)
Gets all attached AvaloniaPropertys registered on a type.
public IReadOnlyList<AvaloniaProperty> GetRegisteredAttached(Type type)
Parameters
type
TypeThe type.
Returns
- IReadOnlyList<AvaloniaProperty>
A collection of AvaloniaProperty definitions.
GetRegisteredDirect(Type)
Gets all direct AvaloniaPropertys registered on a type.
public IReadOnlyList<AvaloniaProperty> GetRegisteredDirect(Type type)
Parameters
type
TypeThe type.
Returns
- IReadOnlyList<AvaloniaProperty>
A collection of AvaloniaProperty definitions.
GetRegisteredDirect<T>(AvaloniaObject, DirectPropertyBase<T>)
Gets a direct property as registered on an object.
public DirectPropertyBase<T> GetRegisteredDirect<T>(AvaloniaObject o, DirectPropertyBase<T> property)
Parameters
o
AvaloniaObjectThe object.
property
DirectPropertyBase<T>The direct property.
Returns
- DirectPropertyBase<T>
The registered.
Type Parameters
T
GetRegisteredInherited(Type)
Gets all inherited AvaloniaPropertys registered on a type.
public IReadOnlyList<AvaloniaProperty> GetRegisteredInherited(Type type)
Parameters
type
TypeThe type.
Returns
- IReadOnlyList<AvaloniaProperty>
A collection of AvaloniaProperty definitions.
IsRegistered(object, AvaloniaProperty)
Checks whether a AvaloniaProperty is registered on a object.
public bool IsRegistered(object o, AvaloniaProperty property)
Parameters
o
objectThe object.
property
AvaloniaPropertyThe property.
Returns
- bool
True if the property is registered, otherwise false.
IsRegistered(Type, AvaloniaProperty)
Checks whether a AvaloniaProperty is registered on a type.
public bool IsRegistered(Type type, AvaloniaProperty property)
Parameters
type
TypeThe type.
property
AvaloniaPropertyThe property.
Returns
- bool
True if the property is registered, otherwise false.
Register(Type, AvaloniaProperty)
Registers a AvaloniaProperty on a type.
public void Register(Type type, AvaloniaProperty property)
Parameters
type
TypeThe type.
property
AvaloniaPropertyThe property.
Remarks
You won't usually want to call this method directly, instead use the Register<TOwner, TValue>(string, TValue, bool, BindingMode, Func<TValue, bool>?, Func<AvaloniaObject, TValue, TValue>?, bool) method.
RegisterAttached(Type, AvaloniaProperty)
Registers an attached AvaloniaProperty on a type.
public void RegisterAttached(Type type, AvaloniaProperty property)
Parameters
type
TypeThe type.
property
AvaloniaPropertyThe property.
Remarks
You won't usually want to call this method directly, instead use the RegisterAttached<THost, TValue>(string, Type, TValue, bool, BindingMode, Func<TValue, bool>?, Func<AvaloniaObject, TValue, TValue>?) method.
UnregisterByModule(IEnumerable<Type>)
Unregister allAvaloniaPropertys registered on types
public bool UnregisterByModule(IEnumerable<Type> types)
Parameters
types
IEnumerable<Type>