Export (0) Print
Expand All
0 out of 2 rated this helpful - Rate this topic

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.

System.Object
  System.Workflow.ComponentModel.DependencyProperty

Namespace:  System.Workflow.ComponentModel
Assembly:  System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)
[SerializableAttribute]
public sealed class DependencyProperty : ISerializable

The DependencyProperty type exposes the following members.

  NameDescription
Public propertyDefaultMetadataGets the PropertyMetadata that represents user-defined data for this DependencyProperty.
Public propertyIsAttachedGets the property that indicates whether this DependencyProperty is associated to a DependencyObject by registration.
Public propertyIsEventGets the property that indicates whether the DependencyProperty is an event Delegate.
Public propertyNameGets the Name of the DependencyProperty.
Public propertyOwnerTypeGets the Type of the DependencyProperty.
Public propertyPropertyTypeGets the Type of the value stored in the DependencyProperty.
Public propertyValidatorTypeGets the Type implementing validation logic specific to the DependencyProperty.
Top
  NameDescription
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodStatic memberFromNameGets the registered DependencyProperty based on the Name and OwnerType.
Public methodStatic memberFromTypeCreates an IList of type DependencyProperty that belong to a specific Type.
Public methodGetHashCodeReturns the hash code for this instance. (Overrides Object.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic memberRegister(String, Type, Type)Initializes a new instance of the DependencyProperty class that has the properties parameterized according to the input parameters.
Public methodStatic memberRegister(String, Type, Type, PropertyMetadata)Initializes a new instance of the DependencyProperty class that has the properties parameterized according to the input parameters.
Public methodStatic memberRegisterAttached(String, Type, Type)Initializes a new instance of the DependencyProperty class that has the properties parameterized according to the input parameters. This instance is intended to declare properties that are used on objects other than the objects of owning type.
Public methodStatic memberRegisterAttached(String, Type, Type, PropertyMetadata)Initializes a new instance of the DependencyProperty class that has the properties parameterized according to the input parameters.
Public methodStatic memberRegisterAttached(String, Type, Type, PropertyMetadata, Type)Initializes a new instance of the DependencyProperty class that has the properties parameterized according to the input parameters.
Public methodToStringOverrides the Object method to return the Name property value. (Overrides Object.ToString().)
Top
  NameDescription
Explicit interface implemetationPrivate methodISerializable.GetObjectDataPopulates a SerializationInfo with the data required to serialize the target object.
Top

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("someone@example.com"));
public static DependencyProperty ToProperty = DependencyProperty.Register("To", typeof(string), typeof(SendEmailActivity), new PropertyMetadata("someone@example.com"));


.NET Framework

Supported in: 4, 3.5, 3.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.