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.

Add colors to XAML resources

Add colors to XAML resources

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

Start my 1-month free trial

Add colors to XAML resources

- [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…

Contents