From the course: Windows Presentation Foundation 4: Brushes and Colors

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Examples of the brushes

Examples of the brushes

From the course: Windows Presentation Foundation 4: Brushes and Colors

Start my 1-month free trial

Examples of the brushes

- [Instructor] I'll show a few examples of the types of brushes you can use in WPF. I'll be using this MainWindow.xaml file, and I'll take a look briefly at the UI. So I've got these different elements on the screen, for instance, I've got this grid, and I'm setting its Background property. The Background property is a brushable property, so I've set that here, and I'll manipulate it in code by clicking at these different buttons. So, get the background. I've also got this, which is called the border. So there's a border that's around this image, and I'm setting its BorderBrush property. Then I have this section of the UI, which is called the header grid. It's another Grid, and I'll be changing its Background property. And then finally, I have these ellipses, in this area of the screen, and I'll be changing the Fill property, that's also another brushable property. The way this works, is each of these buttons applies a different brush, so take this first button and click on it, and…

Contents