Gets or sets the key to use to find the style template for this control in themes. This is a dependency property.
Assembly: PresentationFramework (in PresentationFramework.dll)
'Declaration Protected Friend Property DefaultStyleKey As Object 'Usage Dim value As Object value = Me.DefaultStyleKey Me.DefaultStyleKey = value
This property is typically not set through any of its direct setters. Instead, you override the type-specific metadata of this dependency property every time you create a new subclass. When you subclass, call the OverrideMetadata method against the DefaultStyleKeyProperty identifier, within the static constructor of the control subclass.
For instance, an inline class such as Bold actually has very little implementation beyond overriding the metadata in its static constructor, and exposing several instance constructors. The fact that elements surrounded by the Bold tag gain a FontWeight property of Bold is implemented within the theme style that was referenced by setting the default value of to typeof(Bold).
If you want your element or control to deliberately not use theme styles, set the OverridesDefaultStyle property to true.
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.