Consistency in user interface is an important trait; there are many facets of consistency, one of which is the consistent look and feel of controls. For example, all buttons should look roughly the same—similar colors, fonts, sizes, and so on. Styles provide a convenient way of grouping a set of properties under a single object, and then selectively (or automatically, as we'll see later) apply it to elements.
Styles are always defined as resources (usually at the application level, but can also be at the
UserControl level). Once defined, they can be applied to elements by setting the
Here's a style defined as part of the
Resources section of a
<Page.Resources> <Style TargetType="Button" x:Key="style1"> ...