WPF - Visual C# | Resources exercise | Create a radial gradient brush resource and apply it

This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

The answer to the exercise will be included and explained if you attend the relevant Wise Owl course (sadly, only in the UK for now).

Software ==> WPF - Visual C#  (20 exercises)
Version ==> Any version of WPF
Topic ==> Resources  (3 exercises)
Level ==> Average difficulty
Before you can do this exercise, you'll need to download and unzip this file (if you have any problems doing this, click here for help).

You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

Add the window in the above folder into your project, and change app.xaml to make it the default window:

A menu with 3 buttons

When you run your application, it looks reasonably tasteful. This won't last.


Create a global resource (ie put it in app.xaml) called BlurryEyes, which creates a radial gradient brush.  When you set it as the background to each of your buttons, here's a suggestion for what it could look like:

Psychedelic window

Just for good measure, here we've applied the brush to the window's background too!


Quickly close your window down!

This page has 0 threads Add post