Create reusable colors in XAML resources and access them with the StaticResource and DynamicResource markup extensions.
- [Instructor] It's common in application design…to specify a standard set of colors…that are used throughout the application.…It's also common in the tools that we use…as developers and designers…to have ways of setting those colors in a common repository,…for example in HTML you can put your colors in a CSS file…or in the CSS section on your HTML document…and then use those colors.…It's no different in WPF.…In WPF you use a XAML resource to define the color…and then use a static resource…or a dynamic resource lookup to apply the color.…
In this application I have…three green colors that I want to standardize.…I have one color that's being used in the background…of this window and it's also being used…here for this gradient band.…I have another color that's…used to define the boarders of the shapes…and it's also used in this dark band of the gradient…and then the fill of the ellipse…and the polygon and this band on the gradient…are the third color.…The best place to define a XAML resource that you'll use…across multiple parts of your UI…
- 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?
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.