Better Brushes

As you know, brushes fill an area, whether it's the background, foreground, or border of an element, or the fill or stroke of a shape. You've used brushes throughout this book, but so far you've done most of your work with the straightforward SolidColorBrush. You've also learned these fundamental facts about brushes:

  • Brushes support change notification because they derive from Freezable. As a result, if you change a brush, any elements that use that brush repaint themselves automatically.

  • Brushes support partial transparency. All you need to do is modify the Opacity property to let the background show through.

  • The SystemBrushes class provides access to brushes that use the colors defined in the Windows system preferences for the ...

Get Pro WPF in C# 2008: Windows Presentation Foundation with .NET 3.5, Second Edition 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.