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

Custom Stretching with Nine-Grid

For Windows Store and universal apps, Image has a nifty built-in nine-grid feature that enables you to use a single image as a flexible border by customizing how it stretches. (It’s also hardware accelerated for great performance.) Without this support, you’d need to use up to nine separate images to create the same effect.

Figure 11.1 demonstrates the regular image-stretching behavior using the following Grid that contains the same image unstretched on the left versus stretched (and therefore pixelated) on the right:

<Page ...>  <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">    <Grid.ColumnDefinitions>      <ColumnDefinition Width="Auto"/>      <ColumnDefinition ...

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