Create reusable brushes in XAML resources and access them with the StaticResource and DynamicResource markup extensions.
- [Instructor] In this video, I'll look at how to…define a brush in the XAML resources…and use it elsewhere in the application.…As you can see, I've already got three…colors defined in my app.XAML.…Now, I'll create a solid color brush.…I'll give it an identifying key…that makes sense for the application,…and then I'll set the color property,…and I'll use a static resource lookup…to apply this relaxed green color…as the color for the brush.…It's the same process with creating…other solid color brushes, you can also define…the other types of brushes, image brushes,…visual brushes, you can define gradient brushes,…they can all be defined in here.…
For this example, I'm just using the solid color brush…and later I'll use a gradient brush.…I've got my solid color brush defined,…now I'll go over to my colorless window,…pick my ellipse, and over here in my XAML,…this time when I hit the spacebar,…instead of getting a listing of colors,…the type of the Fill property is brush,…and now it's showing me all of…the brushes that are defined in my XAML.…
- 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.