StyledProperty<TValue> Class
Definition
A styled avalonia property.
public class StyledProperty<TValue>
Methods
| Name | Description |
|---|---|
| AddOwner | No summary available. |
| CoerceValue | No summary available. |
| GetDefaultValue (2 overloads) | Gets the default value for the property on the specified object. |
| GetMetadata (2 overloads) | Gets the Avalonia.AvaloniaPropertyMetadata which applies to this property when it is used with the specified object. |
| OverrideDefaultValue (2 overloads) | Overrides the default value for the property on the specified type. |
| OverrideMetadata (2 overloads) | No summary available. |
| ToString | Gets the string representation of the property. |
AddOwner Method
public Avalonia.StyledProperty<TValue><TValue> AddOwner<TOwner>(Avalonia.StyledPropertyMetadata<TValue><TValue> metadata)
Parameters
metadata Avalonia.StyledPropertyMetadata<TValue><TValue>
Type Parameters
TOwner
Returns
Avalonia.StyledProperty<TValue><TValue>
CoerceValue Method
public TValue CoerceValue(Avalonia.AvaloniaObject instance, TValue baseValue)
Parameters
instance Avalonia.AvaloniaObject
baseValue TValue
Returns
TValue
GetDefaultValue overloads
GetDefaultValue Method
Gets the default value for the property on the specified object.
public TValue GetDefaultValue(Avalonia.AvaloniaObject owner)
Parameters
owner Avalonia.AvaloniaObject
The object.
Returns
TValue
The default value.
GetDefaultValue Method
Gets the default value for the property on the specified type.
public TValue GetDefaultValue(Type type)
Parameters
type Type
The type.
Returns
TValue
The default value.
Remarks
For performance, prefer the Avalonia.StyledProperty<T>.GetDefaultValue(Avalonia.AvaloniaObject) overload when possible.
GetMetadata overloads
GetMetadata Method
Gets the Avalonia.AvaloniaPropertyMetadata which applies to this property when it is used with the specified object.
public Avalonia.StyledPropertyMetadata<TValue><TValue> GetMetadata(Avalonia.AvaloniaObject owner)
Parameters
owner Avalonia.AvaloniaObject
The object for which to retrieve metadata.
Returns
Avalonia.StyledPropertyMetadata<TValue><TValue>
GetMetadata Method
public Avalonia.StyledPropertyMetadata<TValue><TValue> GetMetadata(Type type)
Parameters
type Type
The type for which to retrieve metadata.
Returns
Avalonia.StyledPropertyMetadata<TValue><TValue>
Remarks
For performance, prefer the Avalonia.AvaloniaProperty.GetMetadata(Avalonia.AvaloniaObject) overload when possible.
OverrideDefaultValue overloads
OverrideDefaultValue Method
Overrides the default value for the property on the specified type.
public void OverrideDefaultValue(Type type, TValue defaultValue)
Parameters
type Type
The type.
defaultValue TValue
The default value.
OverrideDefaultValue Method
public void OverrideDefaultValue<T>(TValue defaultValue)
Parameters
defaultValue TValue
Type Parameters
T
OverrideMetadata overloads
OverrideMetadata Method
public void OverrideMetadata<T>(Avalonia.StyledPropertyMetadata<TValue><TValue> metadata)
Parameters
metadata Avalonia.StyledPropertyMetadata<TValue><TValue>
Type Parameters
T
OverrideMetadata Method
public void OverrideMetadata(Type type, Avalonia.StyledPropertyMetadata<TValue><TValue> metadata)
Parameters
type Type
metadata Avalonia.StyledPropertyMetadata<TValue><TValue>
ToString Method
Gets the string representation of the property.
public string ToString()
Returns
string
The property's string representation.
Properties
| Name | Description |
|---|---|
| ValidateValue | A method which returns "false" for values that are never valid for this property. |
ValidateValue Property
A method which returns "false" for values that are never valid for this property.
public Func<TValue, bool> ValidateValue { get; set; }