Printer Friendly Version      Send     
Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Silverlight
Other versions are also available for the following:
.NET Framework Class Library for Silverlight
DependencyProperty Class
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Represents a dependency property that is registered with the Silverlight dependency property system. Dependency properties provide support for value expressions, data binding, animation, and property change notification.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

Visual Basic (Declaration)
Public Class DependencyProperty
Visual Basic (Usage)
Dim instance As DependencyProperty
C#
public class DependencyProperty
Visual C++
public ref class DependencyProperty
JScript
public class DependencyProperty

Custom Dependency Properties

If you want properties on your custom types to support value expressions, data binding, or animation, you should back these CLR properties with a dependency property following these guidelines and procedures:

  1. Register a dependency property using the Register method; this method returns a DependencyProperty, which you should store as an accessible static read-only field in your class. By convention, the name of this DependencyProperty identifier field should end with Property, and this convention is followed by all dependency properties implemented in Silverlight (and WPF). For example, the Control..::.Background dependency property is identified by the Control..::.BackgroundProperty field.

  2. Provide CLR accessors for the property.

System..::.Object
  System.Windows..::.DependencyProperty
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker