views:

41

answers:

1

Hi,

I have created a new Silverlight 4 solution using the Business Application template. The requirement is to style the application and not use the generic template theme. I have installed the Silverlight 4 toolkit and like the BureauBlue theme.

How do I apply the BureauBlue toolkit theme to the entire solution? That is, is there a way to apply the theme globally (similar to attaching a CSS file to an ASP.NET or HTML site) instead of applying the theme to each control?

Thanks, Sid

A: 

I have not experimented with this using a site that runs off an application with many user controls, but this seemed to work for my entire application and may help you.

First you have to have the theme reference added (for example, System.Windows.Controls.Theming.BureauBlue.dll)

Then in your code you can add this line of code:

System.Windows.Controls.Theming.BureauBlueTheme.SetIsApplicationTheme(Application.Current, true);

This applies the theme to the current running application, and if the boolean value is false I believe it will remove the theme.

enforge