Tutorial by Examples

A named style requires the x:Key property to be set and applies only to elements that explicitly reference it by name: <StackPanel> <StackPanel.Resources> <Style x:Key="MyTextBlockStyle" TargetType="TextBlock"> <Setter Property=&qu...
An implicit style applies to all elements of a given type within scope. An implicit style can omit x:Key since it is implicitly the same as the style's TargetType property. <StackPanel> <StackPanel.Resources> <Style TargetType="TextBlock"> <...
It is common to need a base style that defines properties/values shared between multiple styles belonging to the same control, especially for something like TextBlock. This is accomplished by using the BasedOn property. Values are inherited and then can be overridden. <Style x:Key="BaseText...

Page 1 of 1