Brushes

It’s usually not obvious, but XAML elements almost never interact directly with colors. Instead, most uses of color are wrapped inside objects known as Brushes. This is an extremely powerful indirection because many different brushes can be swapped in.

Brush itself exposes three properties: Opacity, Transform, and RelativeTransform. Unlike Transform, RelativeTransform is relative to the size of the area being covered with the Brush.

Brush has several subclasses, and these can be divided into color brushes versus tile brushes. Although this section mostly demonstrates Brushes on a Path, keep in mind that these Brushes can be used as the background, foreground, or outline of just about anything you can put on the screen—even the foreground ...

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.