title: Change Language/Resource programmatically w/ WPF
body: <p>I have a DropDown (using MahApps if that is important) that I'd like to use to switch the language "on the fly" in my program.</p>
  
  <p><strong>Language Class</strong></p>
  
  <pre><code>namespace SAM
  {
      public class Language
      {
          public string Title { get; set; }
          public string Culture { get; set; }
      }
  }
  </code></pre>
  
  <p><strong>Change Language</strong></p>
  
  <pre><code>private void DropLanguage_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
  {
      Language lang = DropLanguage.SelectedItem as Language;
      System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang.Culture);
  }
  </code></pre>
  
  <p>I have all my strings as resources in <code>Resources.resx</code> (default) and <code>Resources.en.resx</code> (english)</p>
  
  <p><strong>3 issues I don't understand</strong></p>
  
  <ul>
  <li>When selecting "englisch" from the dropdown, the language does not change immediately but when I click sth. else, e.g. "close" (it asks "sure?"), the language has changed.</li>
  <li>Strings that are directly in the .xaml file like <code>&lt;TextBlock Text="{x:Static p:Resources.Config_HeaderBar_Find_Speaker}" /&gt;</code> do not get updated at all.</li>
  <li>Bonus: How would I switch back to the default language, as <code>new CultureInfo(lang.Culture);</code> expects one parameter and for the default I have <code>Culture = null</code> (as the Resources.resx has nothing in it's name). Changing the file to <code>Resources.default.resx</code> messes with my code a lot...</li>
  </ul>