Rediger

DependencyPropertyConverter Class

Definition

Converts from a string to a DependencyProperty object.

public ref class DependencyPropertyConverter sealed : System::ComponentModel::TypeConverter
public sealed class DependencyPropertyConverter : System.ComponentModel.TypeConverter
type DependencyPropertyConverter = class
    inherit TypeConverter
Public NotInheritable Class DependencyPropertyConverter
Inherits TypeConverter
Inheritance
DependencyPropertyConverter

Remarks

The DependencyPropertyConverter class only converts from a String into an instance of DependencyProperty. Other attempts at conversion throw an exception.

The DependencyPropertyConverter converts from a String using the following input format: typeName.propertyName. A format of namespacePrefix:typeName.propertyName is also accepted for legacy reasons but the namespacePrefix: component is ignored. A format of propertyName is also accepted in certain cases; this format relies on the ability to evaluate ambient properties and deduce the typeName, by service implementation of IAmbientProvider in the context.

For legacy reasons, this class also supports conversion from BAML records, but this is an implementation detail and should not be relied upon.

The behavior of this converter is specifically oriented around a single WPF scenario for XAML processing: reading the attribute value of Property and generating a DependencyProperty value.

Constructors

Name Description
DependencyPropertyConverter()

Initializes a new instance of the DependencyPropertyConverter class.

Methods

Name Description
CanConvertFrom(ITypeDescriptorContext, Type)

Determines whether an object of the specified type can be converted to an instance of DependencyProperty.

CanConvertTo(ITypeDescriptorContext, Type)

Determines whether an instance of DependencyProperty can be converted to the specified type.

ConvertFrom(ITypeDescriptorContext, CultureInfo, Object)

Attempts to convert the specified object to a DependencyProperty, using the specified context.

ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type)

Attempts to convert a DependencyProperty to the specified type, using the specified context. Always throws an exception.

Applies to