This documentation is archived and is not being maintained.

DependencyProperty.GetMetadata Method (DependencyObjectType)

Returns the metadata for this dependency property as it exists on a specified type.

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

public PropertyMetadata GetMetadata (
	DependencyObjectType dependencyObjectType
)
public PropertyMetadata GetMetadata (
	DependencyObjectType dependencyObjectType
)
public function GetMetadata (
	dependencyObjectType : DependencyObjectType
) : PropertyMetadata
You cannot use methods in XAML.

Parameters

dependencyObjectType

A specific object that records the dependency object type from which the dependency property metadata is desired.

Return Value

A property metadata object.

Specifying either the type or an object reference is necessary because the metadata of any given dependency property can vary from the original registration due either to AddOwner or OverrideMetadata calls that can refine the property metadata as it exists on a type.

The following example gets metadata for a dependency property based on its DependencyObjectType.

DependencyObjectType dt = unrelatedInstance.DependencyObjectType;
pm = UnrelatedStateControl.StateProperty.GetMetadata(dt);

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: