home       archive       nukeation.com     about      articles       contact       rss

Reuxables FAQs

 

How do I change themes from code?

Use the following code to change themes from code. Replace the filename of the ResourceDictionary with the appropriate filename.


Visual Basic

Application.Current.Resources.MergedDictionaries.Clear()
Dim UX As New Uri("Themes/MY_THEME_FILE.xaml", UriKind.RelativeOrAbsolute)
Dim RD As New ResourceDictionary()
RD.Source = UX
Application.Current.Resources.MergedDictionaries.Add(RD)
C#
Application.Current.Resources.MergedDictionaries.Clear();
Uri UX = new Uri("Themes/MY_THEME_FILE.xaml", UriKind.RelativeOrAbsolute);
ResourceDictionary RD = new ResourceDictionary();
RD.Source = UX;
Application.Current.Resources.MergedDictionaries.Add(RD);

 
 

When I apply the theme, it does not show the background color as shown in the demo.

All Reuxables Themes ship with a special brush called "WindowBackgroundBrush". Bind your Window or Page root element's Background property, and you will get the appropriate background.

<Grid Background="{DynamicResource WindowBackgroundBrush}">

 

 

More FAQs at http://www.nukeation.com/reuxables.aspx?id=faq





Posted on April 2, 2009 22:11

E-mail | Permalink | Comments (1) | Trackback | Digg! | Kick it! | DZone it! | del.icio.us

Related posts

Comments

Comments are closed

Powered by the awesome BlogEngine.NET 1.3.0.0 | Designed by Nukeation Studios. www.nukeation.com

Sign in


Subscribe to Dax Pandhi's Blog by Email