Tile Brushes

The remaining brushes are tile brushes, because they derive from a TileBrush base class. In WPF, you can specify the brush’s content as infinitely repeating tiles and configure the tiling pattern in a number of different ways. In the other XAML-based UI Frameworks, however, none of these options exist. Instead, the way to think about a tile brush is a brush that contains bitmap-based content.

ImageBrush

ImageBrush enables you to use the contents of an image file. This is demonstrated with the following XAML:

<Ellipse Width="400" Height="100">  <Ellipse.Fill>    <ImageBrush ImageSource="Assets/flower.jpg"/>   </Ellipse.Fill></Ellipse>

The flower.jpg image file is shown in Figure 7.24, and the rendered ...

Get XAML Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.