Export (0) Print
Expand All

DictionaryKeyPropertyAttribute Class

Updated: July 2008

Specifies a property of the associated class implementation that provides the implicit key value, when the class is included as an item in an IDictionary collection.

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

[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public sealed class DictionaryKeyPropertyAttribute : Attribute
You cannot directly create an instance of this class in XAML.

Items in an IDictionary collection (such as the WPF ResourceDictionary) require a key. In XAML the key is normally specified by x:Key in the markup. The DictionaryKeyPropertyAttribute is applied to classes that work with an implicit key, where the key to use for the IDictionary comes from a different existing property value. In this way, the class applying the DictionaryKeyPropertyAttribute can be included in an IDictionary without an explicit key so long as the property referenced by IDictionary has a value that is valid as a key.

System.Object
  System.Attribute
    System.Windows.Markup.DictionaryKeyPropertyAttribute

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5 SP1, 3.0 SP2

Date

History

Reason

July 2008

Added topic for new class.

SP1 feature change.

Community Additions

ADD
Show:
© 2014 Microsoft