This documentation is archived and is not being maintained.

DependencyProperty Class

A special kind of property that can be defined or attached to a DependencyObject. There are three kinds of dependency properties: instance properties, meta properties, and attached properties. This class cannot be inherited.

Namespace:  System.Workflow.ComponentModel
Assembly:  System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)

public sealed class DependencyProperty : ISerializable

Dependency properties support three use cases. First, if an instance property of an activity is implemented by using a dependency property, that property can be assigned an ActivityBind instead of an actual value. Second, activity properties that are metadata (that is, the value cannot change at run time) should be implemented by using dependency properties, specifying the Metadata option. Third, dependency properties support attached properties, which are properties that are applied to dependency objects dynamically.

The following example shows how to register a DependencyProperty for use by a DependencyObject. This code example is part of the Send E-mail SDK sample and is from the SendMailActivity.cs file. For more information, see Send Mail Activity.

// Define the DependencyProperty objects for all of the Properties  
// ...and Events exposed by this activity 
public static DependencyProperty FromProperty = DependencyProperty.Register("From", typeof(string), typeof(SendEmailActivity), new PropertyMetadata(""));
public static DependencyProperty ToProperty = DependencyProperty.Register("To", typeof(string), typeof(SendEmailActivity), new PropertyMetadata(""));


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0