Control.DefaultStyleKey Property
Silverlight
Gets or sets the key that references the default style for the control.
Namespace: System.Windows.Controls
Assembly: System.Windows (in System.Windows.dll)
Property Value
Type: System.ObjectThe 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.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
How, why and where you'd use this.
Using this property is part of building custom controls for Silverlight. Reading the MSDN documentation here will not help to furnish you with the full understanding of the process, so I recommend looking up Karen Corby's sessions at MIX (Silverlight 2.0, but still relevant). The only MS article I can find on the subject is here:
http://msdn.microsoft.com/en-us/magazine/cc721611.aspx#id0430021
- 5/18/2012
- LukePuplett
- 5/18/2012
- LukePuplett