From the course: Microsoft XAML: 3 Type Converters and Resources

Unlock the full course today

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

Colors in resources

Colors in resources

From the course: Microsoft XAML: 3 Type Converters and Resources

Start my 1-month free trial

Colors in resources

- [Instructor] One standard I see a lot in sample applications is defining a common set of colors and brushes that you use throughout your application. We're seeing how to use brushes in some of the other videos. Here's an example on line 15 I've got a solid color brush and the key for that is main brush and it's a pink brush and then I also have another one here that's called accent brush, and this is another standard you see, instead of using keys like pink brush and lavender brush it's better to use a name that reflects its function. Main border brush, main brush, accent color brush, something like that. That way, let's call this pink brush and I decided that pink was not the right color I'd have to change the key and I'd also have to change all my places where I use that key in my static resources. On line 13 and line 14 I've declared a color resource. You see the syntax is pretty simple, it's color and then the key and then in between the beginning and ending tags is the…

Contents