Overriding some theme styles and properties per module

426 Views Asked by At

I am writing a WPF application using "Prism", and some purchased Grid theme is applied "Xceed Theme." I am designing a huge change required by our customer to give them the option of modifying some properties (like the background of selected row, for example) and this functionality to be available per screen "Module."

So my questions are:

  1. After adding my xceed grid theme source to my App.xaml merged dictionaries, how can I override some of its styles (that I know the keys of) in another xaml file away from app.xaml (possibly by adding BasedOn to the style tag)?
  2. Is it possible to create a custom resource dictionary for each module and add it to the app.xaml merged dictionaries while loading?
2

There are 2 best solutions below

0
Lee Louviere On

You could add the style changes in the main window/control's resources within each module. Then the differences would apply to each module separately.

1
Ehsan Zargar Ershadi On

In my case, I have userd Dynamic Resources. The main project loads the main style. somthing like this :

<FontFamily x:Key="ApplicationFontFamily">Tahoma</FontFamily>

and in my module i have changed it programmatically :

Application.Current.Resources["ApplicationFontFamily"] = new FontFamily("Arial");

it worked for me ;)