Class AttachedPropertyInfo<T>
Generic attached property metadata and accessor.
public class AttachedPropertyInfo<T> : BaseAttachedPropertyInfo
Type Parameters
TThe type of the property value.
- Inheritance
-
AttachedPropertyInfo<T>
- Inherited Members
Constructors
AttachedPropertyInfo(int, string, Type, T, AttachedPropertyOption, Attribute[])
Initializes a new instance of the AttachedPropertyInfo<T> class.
public AttachedPropertyInfo(int id, string name, Type ownerType, T defaultValue, AttachedPropertyOption option, Attribute[] attributes = null)
Parameters
idintThe unique identifier for the property.
namestringThe name of the property.
ownerTypeTypeThe type that owns the property.
defaultValueTThe default value for the property.
optionAttachedPropertyOptionThe option specifying how the property affects layout.
attributesAttribute[]Optional attributes for the property.
Properties
DefaultValue
Gets the default value for this property.
public T DefaultValue { get; }
Property Value
- T
DefaultValueObject
Gets the default value for this property as an object.
public override object DefaultValueObject { get; }
Property Value
PropertyType
Gets the type of the property value.
public override Type PropertyType { get; }
Property Value
Methods
GetValue(BaseObject)
Gets the property value from the specified object.
public T GetValue(BaseObject obj)
Parameters
objBaseObjectThe object to get the property value from.
Returns
- T
The property value, or the default value if not set.
GetValueObject(BaseObject)
Gets the property value from the specified object as an object.
public override object GetValueObject(BaseObject widget)
Parameters
widgetBaseObjectThe object to get the property value from.
Returns
- object
The property value as an object.
SetValue(BaseObject, T)
Sets the property value on the specified object.
public void SetValue(BaseObject obj, T value)
Parameters
objBaseObjectThe object to set the property value on.
valueTThe property value to set.
SetValueObject(BaseObject, object)
Sets the property value on the specified object from an object.
public override void SetValueObject(BaseObject widget, object value)
Parameters
widgetBaseObjectThe object to set the property value on.
valueobjectThe property value to set as an object.