Table of Contents

Class DependencyProperty

Namespace
Alternet.UI
Assembly
Alternet.UI.dll

An attached dependency-based property

[TypeConverter("System.Windows.Markup.DependencyPropertyConverter, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
[ValueSerializer(typeof(DependencyPropertyValueSerializer))]
public sealed class DependencyProperty : IPropertyInfo
Inheritance
DependencyProperty
Implements

Remarks

A DependencyProperty supports the following capabilities in Alternet UI:

  • The property can be set through data binding. For more information about data binding dependency properties, see Data binding.

  • The property can inherit its value automatically from a parent element in the element tree.

  • The property can report when the previous value of the property has been changed, and the property value can be coerced.

  • The property reports information to Alternet UI, such as whether changing a the property value should require the layout system to recompose the visuals for an element.

To learn more about dependency properties, see Dependency Properties. If you want properties on your custom types to support the capabilities in the preceding list, you should create a dependency property.

An attached property is a property that enables any object to report information to the type that defines the attached property. In Alternet UI, any type that inherits from DependencyObject can use an attached property regardless of whether the type inherits from the type that defines the property. An attached property is a feature of the UIXML language. To set an attached property in UIXML, use the ownerType.propertyName syntax. An example of an attached property is the Grid.Column attached property implemented by the GetColumn/SetColumn methods. If you want to create a property that can be used on all DependencyObject types, then you should create an attached property.

Fields

UnsetValue

Standard unset value

Properties

DefaultMetadata

Default metadata for the property

GlobalIndex

Zero-based globally unique index of the property

Name

Name of the property

OwnerType

Owning type of the property

PropertyType

Type of the property

ReadOnly

Set/Value value disabling

ValidateValueCallback

Value validation callback

Methods

AddOwner(Type)

Associate another owner type with this property

AddOwner(Type, PropertyMetadata)

Associate another owner type with this property

FromName(string, Type)

Find a property from name

GetHashCode()

Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table

GetMetadata(DependencyObject)

Retrieve metadata for a provided DependencyObject

GetMetadata(DependencyObjectType)

Reteive metadata for a DependencyObject type described by the given DependencyObjectType

GetMetadata(Type)

Retrieve metadata for a provided type

IsValidType(object)

Used to determine if given value is appropriate for the type of the property

IsValidValue(object)

Used to determine if given value is appropriate for the type of the property and the range of values (as specified via the ValidateValueCallback) within that type

OverrideMetadata(Type, PropertyMetadata)

Supply metadata for given type & run static constructors if needed.

OverrideMetadata(Type, PropertyMetadata, DependencyPropertyKey)
Supply metadata for a given type, overriding a property that is

read-only. If property is not read only, tells user to use the Plain Jane OverrideMetadata instead.

Register(string, Type, Type)

Register a Dependency Property

Register(string, Type, Type, PropertyMetadata)

Register a Dependency Property

Register(string, Type, Type, PropertyMetadata, ValidateValueCallback)

Register a Dependency Property

RegisterAttached(string, Type, Type)

Register an attached Dependency Property

RegisterAttached(string, Type, Type, PropertyMetadata)

Register an attached Dependency Property

RegisterAttached(string, Type, Type, PropertyMetadata, ValidateValueCallback)

Register an attached Dependency Property

RegisterAttachedReadOnly(string, Type, Type, PropertyMetadata)

Simple registration, metadata, validation, and a read-only property key. Calling this version restricts the property such that it can only be set via the corresponding overload of DependencyObject.SetValue.

RegisterAttachedReadOnly(string, Type, Type, PropertyMetadata, ValidateValueCallback)

Simple registration, metadata, validation, and a read-only property key. Calling this version restricts the property such that it can only be set via the corresponding overload of DependencyObject.SetValue.

RegisterReadOnly(string, Type, Type, PropertyMetadata)

Simple registration, metadata, validation, and a read-only property key. Calling this version restricts the property such that it can only be set via the corresponding overload of DependencyObject.SetValue.

RegisterReadOnly(string, Type, Type, PropertyMetadata, ValidateValueCallback)

Simple registration, metadata, validation, and a read-only property key. Calling this version restricts the property such that it can only be set via the corresponding overload of DependencyObject.SetValue.

ToString()

String representation