title: WPF and MVVM - changing themes dynamically
body: <p>I'm working on a WPF project using MVVM and I'm trying to implement a feature that changes the theme dynamically. The theming info is located in separate xaml files (ie Theme1.xaml, Theme2.xaml). I want to do the actual theme changing in the ViewModel class rather than in the code behind file of View.xaml for various reasons. </p>
  
  <p>I've tried a couple ideas but can't get anything to work:</p>
  
  <ul>
  <li><p>I tried binding the ResourceDictionary of View to a variable in ViewModel but am told that a binding cannot be set on the Source property of type ResourceDictionary</p></li>
  <li><p>I don't have any sort of View object in my ViewModel class on which to call a "UpdateTheme" method</p></li>
  </ul>
  
  <p>Any ideas on how I can change the MergedDictionary reference in my View class from the ViewModel class?</p>
  
  <p>Thanks!</p>