O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implicit Styles

Unlike other objects placed in a Resources collection, you can omit the x:Key and x:Name from a Style! If you do this, the target type of the Style (for example, typeof(Button)) is used as the key in the ResourceDictionary. This is handy, because it causes the Style to be implicitly applied to all elements of that target type within the same scope. This is typically called a typed style or implicit style as opposed to a named style.

The scope of a typed Style is determined by the location of the Style resource. For example, it would implicitly apply to all relevant elements in a Page if it’s added to the Page’s Resources collection or all relevant elements in the app if it’s added to Application’s Resources collection. The following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required