DependencyProperty.GetMetadata Method (Type)

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

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

public PropertyMetadata GetMetadata (
	Type forType
public PropertyMetadata GetMetadata (
	Type forType
public function GetMetadata (
	forType : Type
) : PropertyMetadata
You cannot use methods in XAML.



The specific type from which to retrieve the dependency property metadata.

Return Value

A property metadata object.

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

The following example gets metadata for a dependency property based on its type. The type is obtained by using a typeof operator.

pm = MyStateControl.StateProperty.GetMetadata(typeof(MyStateControl));

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

Community Additions