Click to Rate and Give Feedback
MSDN
MSDN Library
Collapse All/Expand All Collapse All
.NET Framework Class Library for Silverlight
DependencyProperty..::.Register Method
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Registers a dependency property with the specified property name, property type, owner type, and property changed callback for the property.

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

Visual Basic (Declaration)
Public Shared Function Register ( _
    name As String, _
    propertyType As Type, _
    ownerType As Type, _
    propertyChangedCallback As PropertyChangedCallback _
) As DependencyProperty
Visual Basic (Usage)
Dim name As String
Dim propertyType As Type
Dim ownerType As Type
Dim propertyChangedCallback As PropertyChangedCallback
Dim returnValue As DependencyProperty

returnValue = DependencyProperty.Register(name, _
    propertyType, ownerType, propertyChangedCallback)
C#
public static DependencyProperty Register(
    string name,
    Type propertyType,
    Type ownerType,
    PropertyChangedCallback propertyChangedCallback
)
Visual C++
public:
static DependencyProperty^ Register(
    String^ name, 
    Type^ propertyType, 
    Type^ ownerType, 
    PropertyChangedCallback^ propertyChangedCallback
)
JScript
public static function Register(
    name : String, 
    propertyType : Type, 
    ownerType : Type, 
    propertyChangedCallback : PropertyChangedCallback
) : DependencyProperty

Parameters

name
Type: System..::.String

The name of the dependency property to register.

propertyType
Type: System..::.Type

The type of the property.

ownerType
Type: System..::.Type

The owner type that is registering the dependency property.

propertyChangedCallback
Type: System.Windows..::.PropertyChangedCallback

A PropertyChangedCallback implementation reference.

Return Value

Type: System.Windows..::.DependencyProperty

A dependency property identifier that should be used to set the value of a public static readonly field in your class. That identifier is then used to reference the dependency property later, for operations such as setting its value programmatically.

© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker