Create a SolidColorBrush in XAML and apply to various elements in the application UI.
- [Voiceover] I find that when working…with solid color brushes, it's more common…to set them in XAML than to set them in your C# code.…So that's what I'll look at in this movie…and in the next movie.…In this movie I'll look at how to use…the more verbose syntax for setting…the solid color brush in my XAML…and in the next video I'll look at how to use…a type converter to simplify it somewhat.…I'm working with the same UI from the previous example.…Here I have three ellipses inside this window,…I want to set the fill property and the stroke property…for this middle ellipse.…
Let's review what I did in the prior example.…In my C# code I instantiated a brush,…then I set the brush's color and on this last line here,…I assigned the brush to the fill property.…Here's how you do the same thing in XAML.…Start with the ellipse, and I want to set the fill property.…So I will add an ending element, then I'll go…and use this syntax, which is called a property element.…Essentially, this is the fill property on this ellipse.…
- Working with brushes
- Painting properties
- Painting in code
- Working with RGB channels
- Using hexadecimal values
- Setting opacity and transparency
- Editing color in the Visual Studio Color Editor
- Using gradient brushes
- Decorating with tiled brushes
- Adding brushes and colors to resources
- Working with opacity masks
Skill Level Intermediate
Windows Presentation Foundation: 2 Layoutwith Walt Ritscher2h 13m Intermediate
1. Brush and Color Overview
3. The Visual Studio Color Editor
4. The Gradient Brushes
5. The Tiled Brushes
6. Brushes and Colors in Resources
7. Opacity Mask
Examples of opacity patterns6m 47s
Next steps1m 11s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.