Edit

Share via


PropertyPath Constructors

Definition

Initializes a new instance of the PropertyPath class.

Overloads

PropertyPath(Object)

Initializes a new instance of the PropertyPath class.

PropertyPath(String, Object[])

Initializes a new instance of the PropertyPath class, with the provided pathing token string and parameters.

PropertyPath(Object)

Initializes a new instance of the PropertyPath class.

public:
 PropertyPath(System::Object ^ parameter);
public PropertyPath (object parameter);
new System.Windows.PropertyPath : obj -> System.Windows.PropertyPath
Public Sub New (parameter As Object)

Parameters

parameter
Object

A property path that either describes a path to a common language runtime (CLR) property, or a single dependency property.

Remarks

This constructor has two completely different usages depending on whether it is being used for a source-mode property path for a binding, or for a target-mode single-step property path for a storyboard target.

If using this PropertyPath in source mode for a binding, parameter is a string representing a property name, or can be a string that describes a "step-through" path to the property in the CLR object model of the object that is being used as the source for a binding. For a binding property path, the character that identifies a "step" is a dot (.). Indexer references (including multiple indexers, and type differentiation) are also supported. For more details on the syntax of the string as specifically used by the Binding object, see Binding.Path. A property used as a binding source need not be a dependency property. If the binding updates two-way, the property referenced must be read-write. Also note that the binding target does have to be a dependency property. For details, see Data Binding Overview.

If using this PropertyPath in target mode for a single-step path for a storyboard target, parameter is generally provided as type DependencyProperty. You can also specify a string that is the Name. Either of these evaluate to the same result, because it is stored internally as a string. A provided DependencyProperty is converted to a string through DependencyPropertyConverter. The DependencyPropertyConverter supports a qualified naming format for dependency properties, so you can specify a typeName.propertyName qualified dependency property name string to the PropertyPath.PropertyPath constructor in code. The qualified path to the dependency property identifier is a different concept than a complex path. A complex-path PropertyPath should instead be created with the PropertyPath.PropertyPath constructor.

See also

Applies to

PropertyPath(String, Object[])

Initializes a new instance of the PropertyPath class, with the provided pathing token string and parameters.

public:
 PropertyPath(System::String ^ path, ... cli::array <System::Object ^> ^ pathParameters);
public PropertyPath (string path, params object[] pathParameters);
new System.Windows.PropertyPath : string * obj[] -> System.Windows.PropertyPath
Public Sub New (path As String, ParamArray pathParameters As Object())

Parameters

path
String

A string that specifies the Path, in a tokenized format.

pathParameters
Object[]

An array of objects that sets the PathParameters.

Remarks

This signature is generally only used for target-mode PropertyPath usages with complex paths.

This constructor supports params for the pathParameters constructor argument. Therefore you can specify the contents of pathParameters as a series of comma-separated constructor arguments that populate the array, rather than needing to dimension an array and then populate it with the pathParameters items. Each item you specify must be one of the following types: DependencyProperty, PropertyInfo, PropertyDescriptor.

For more information on the requirements of the parameters, see Path and PathParameters.

Applies to