title: How to implement theming in wpf
body: <p>I want to implement ASP.Net type theme in WPF. User have selection of various predefined themes and can switch to another theme.</p>
  
  <p>To implement this I have tried by creating different resourcedictionary for each theme and store required style with key. The collection of keys are same in all themes but its definition is different in each.</p>
  
  <p>I am using below code to switch theme on click:</p>
  
  <pre><code>var theme = Application.LoadComponent(uri) as ResourceDictionary;
  Application.Current.Resources.MergedDictionaries.Clear();
  Application.Current.Resources.MergedDictionaries.Add(theme);
  </code></pre>
  
  <p>In all pages/ usercontrol/ windows I have set StaticResource and applied appropriate key. 
  When I switch to another theme it is <strong>only applied after next event on UI</strong>. </p>
  
  <p>If I set change StaticResource to DynamicResource then it is applied on immediately.</p>
  
  <p>Please share your idea to achieve this with StaticResource?</p>