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

Style Inheritance

The SDKs for the various XAML-based UI frameworks include a generic.xaml file that contains, among other things, the XAML for Styles defined by the framework. For Windows Store apps, you can locate it in %ProgramFiles(x86)%\Windows Kits\8.1\Include\WinRT\Xaml\Design\generic.xaml. This file contains many good examples, including some hidden gems you might want to use or tweak for your apps.

The following Style called BaseTextBlockStyle sets several properties to make a TextBlock match the typical style of labels in Windows Store apps (and remove those pesky side bearings, explained in Chapter 12, “Text”):

<Style x:Key="BaseTextBlockStyle" TargetType="TextBlock">  <Setter Property="FontSize"           ...

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