AvaloniaProperty Class
Definition
Base class for avalonia properties.
public class AvaloniaProperty
Methods
| Name | Description |
|---|---|
| Bind | Returns a binding accessor that can be passed to Avalonia.AvaloniaObject's [] operator to initiate a binding. |
| Equals (2 overloads) | No summary available. |
| GetHashCode | No summary available. |
| GetMetadata (3 overloads) | No summary available. |
| IsValidValue | Checks whether the value is valid for the property. |
| Register | No summary available. |
| RegisterAttached (2 overloads) | No summary available. |
| RegisterDirect | No summary available. |
| ToString | Gets the string representation of the property. |
| Unregister | No summary available. |
Bind Method
Returns a binding accessor that can be passed to Avalonia.AvaloniaObject's [] operator to initiate a binding.
public Avalonia.Data.IndexerDescriptor Bind()
Returns
Avalonia.Data.IndexerDescriptor
A Avalonia.Data.IndexerDescriptor.
Remarks
The ! and ~ operators are short forms of this.
Equals overloads
Equals Method
public bool Equals(Avalonia.AvaloniaProperty other)
Parameters
other Avalonia.AvaloniaProperty
Returns
bool
Equals Method
public bool Equals(object obj)
Parameters
obj object
Returns
bool
GetHashCode Method
public int GetHashCode()
Returns
int
GetMetadata overloads
GetMetadata Method
public Avalonia.AvaloniaPropertyMetadata GetMetadata<T>()
Type Parameters
T
Returns
GetMetadata Method
Gets the Avalonia.AvaloniaPropertyMetadata which applies to this property when it is used with the specified object.
public Avalonia.AvaloniaPropertyMetadata GetMetadata(Avalonia.AvaloniaObject owner)
Parameters
owner Avalonia.AvaloniaObject
The object for which to retrieve metadata.
Returns
GetMetadata Method
public Avalonia.AvaloniaPropertyMetadata GetMetadata(Type type)
Parameters
type Type
The type for which to retrieve metadata.
Returns
Avalonia.AvaloniaPropertyMetadata
Remarks
For performance, prefer the Avalonia.AvaloniaProperty.GetMetadata(Avalonia.AvaloniaObject) overload when possible.
IsValidValue Method
Checks whether the value is valid for the property.
public bool IsValidValue(object value)
Parameters
value object
The value.
Returns
bool
True if the value is valid, otherwise false.
Register Method
public Avalonia.StyledProperty<TValue><TValue> Register<TOwner, TValue>(string name, TValue defaultValue, bool inherits, Avalonia.Data.BindingMode defaultBindingMode, Func<TValue, bool> validate, Func<Avalonia.AvaloniaObject, TValue, TValue> coerce, bool enableDataValidation)
Parameters
name string
defaultValue TValue
inherits bool
defaultBindingMode Avalonia.Data.BindingMode
validate Func<TValue, bool>
coerce Func<Avalonia.AvaloniaObject, TValue, TValue>
enableDataValidation bool
Type Parameters
TOwner
TValue
Returns
Avalonia.StyledProperty<TValue><TValue>
RegisterAttached overloads
RegisterAttached Method
public Avalonia.AttachedProperty<TValue><TValue> RegisterAttached<THost, TValue>(string name, Type ownerType, TValue defaultValue, bool inherits, Avalonia.Data.BindingMode defaultBindingMode, Func<TValue, bool> validate, Func<Avalonia.AvaloniaObject, TValue, TValue> coerce)
Parameters
name string
ownerType Type
defaultValue TValue
inherits bool
defaultBindingMode Avalonia.Data.BindingMode
validate Func<TValue, bool>
coerce Func<Avalonia.AvaloniaObject, TValue, TValue>
Type Parameters
THost
TValue
Returns
Avalonia.AttachedProperty<TValue><TValue>
RegisterAttached Method
public Avalonia.AttachedProperty<TValue><TValue> RegisterAttached<TOwner, THost, TValue>(string name, TValue defaultValue, bool inherits, Avalonia.Data.BindingMode defaultBindingMode, Func<TValue, bool> validate, Func<Avalonia.AvaloniaObject, TValue, TValue> coerce)
Parameters
name string
defaultValue TValue
inherits bool
defaultBindingMode Avalonia.Data.BindingMode
validate Func<TValue, bool>
coerce Func<Avalonia.AvaloniaObject, TValue, TValue>
Type Parameters
TOwner
THost
TValue
Returns
Avalonia.AttachedProperty<TValue><TValue>
RegisterDirect Method
public Avalonia.DirectProperty<TOwner,TValue><TOwner, TValue> RegisterDirect<TOwner, TValue>(string name, Func<TOwner, TValue> getter, Action<TOwner, TValue> setter, TValue unsetValue, Avalonia.Data.BindingMode defaultBindingMode, bool enableDataValidation)
Parameters
name string
getter Func<TOwner, TValue>
setter Action<TOwner, TValue>
unsetValue TValue
defaultBindingMode Avalonia.Data.BindingMode
enableDataValidation bool
Type Parameters
TOwner
TValue