muckdog12
muckdog12

Reputation: 51

Setting a theme in WPF

I have a relativly simple question that I can't seem to figure out. I have downloaded some theme files in an XAML format off the internet and I would like to use them as my themes in my WPF application. How do you do this? All help is appreciated!

Upvotes: 2

Views: 3333

Answers (2)

Mav3rick
Mav3rick

Reputation: 774

Add the theme.xaml file to your project(right click->Add Existing Item...). Then in your App.xaml file add the following code

<Application.Resources>
<ResourceDictionary Source="ThemeFile.xaml" />
</Application.Resources>

Replacing ThemeFile.xaml with the name of the theme file you wish to use.

Upvotes: 3

Reed Copsey
Reed Copsey

Reputation: 564413

You can put the elements in App.xaml, and they'll automatically trickle down. This can either be done directly (copy and paste), or via a merged resource dictionary, where app.xaml just references the .xaml file(s) of your theme.

Upvotes: 1

Related Questions