Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This topic has not yet been rated - Rate this topic

Control.DefaultStyleKey Property

May 02, 2013

Gets or sets the key that references the default style for the control.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
protected Object DefaultStyleKey { get; set; }

Property Value

Type: System.Object
The key that references the default style for the control. To work correctly as part of theme style lookup, this value is expected to be the Type of the control being styled.

Dependency property identifier field: DefaultStyleKeyProperty

To provide a default Style for a control that inherits from Control set the DefaultStyleKey property to the same type of the TargetType property. If you do not set the DefaultStyleKey, the default style for the base class is used. For example, if a control called NewButton inherits from Button, to use a new default Style, set DefaultStyleKey to the type, NewButton. If you do not set DefaultStyleKey, the Style for Button is used.

Windows Phone OS

Supported in: 8.0, 7.1, 7.0

Windows Phone

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.