DependencyPropertyDescriptor.FromProperty Method

Definition

Returns a DependencyPropertyDescriptor based either on a provided PropertyDescriptor or a provided type, depending on the signature used.

Overloads

FromProperty(DependencyProperty, Type)

Returns a DependencyPropertyDescriptor for a provided dependency property and target type.

FromProperty(PropertyDescriptor)

Returns a DependencyPropertyDescriptor for a provided PropertyDescriptor.

FromProperty(DependencyProperty, Type)

Returns a DependencyPropertyDescriptor for a provided dependency property and target type.

public:
 static System::ComponentModel::DependencyPropertyDescriptor ^ FromProperty(System::Windows::DependencyProperty ^ dependencyProperty, Type ^ targetType);
public static System.ComponentModel.DependencyPropertyDescriptor FromProperty (System.Windows.DependencyProperty dependencyProperty, Type targetType);
static member FromProperty : System.Windows.DependencyProperty * Type -> System.ComponentModel.DependencyPropertyDescriptor
Public Shared Function FromProperty (dependencyProperty As DependencyProperty, targetType As Type) As DependencyPropertyDescriptor

Parameters

dependencyProperty
DependencyProperty

The identifier for a dependency property.

targetType
Type

The type of the object where the property is set.

Returns

A DependencyPropertyDescriptor for the provided dependency property.

Remarks

The dependencyProperty may refer to a dependency property or an attached property. targetType is the type of object you want to set the property for. For dependency properties, that type is equivalent to the OwnerType for the dependencyProperty. For attached properties the targetType is typically some other DependencyObject type.

Applies to

FromProperty(PropertyDescriptor)

public:
 static System::ComponentModel::DependencyPropertyDescriptor ^ FromProperty(System::ComponentModel::PropertyDescriptor ^ property);
public static System.ComponentModel.DependencyPropertyDescriptor FromProperty (System.ComponentModel.PropertyDescriptor property);
static member FromProperty : System.ComponentModel.PropertyDescriptor -> System.ComponentModel.DependencyPropertyDescriptor
Public Shared Function FromProperty (property As PropertyDescriptor) As DependencyPropertyDescriptor

Parameters

property
PropertyDescriptor

The PropertyDescriptor to check.

Returns

If the property described by property is a dependency property, returns a valid DependencyPropertyDescriptor. Otherwise, returns a nullDependencyPropertyDescriptor.

Remarks

This method is the primary method used by designer applications to obtain a DependencyPropertyDescriptor on basis of checking all properties for a PropertyDescriptor.

Applies to