title: WPF Localize Extension : Translate window at run-time
body: <p>I'm in the process of translating a WPF window. I'm using <a href="http://wpflocalizeextension.codeplex.com/" rel="nofollow">WPF Localize Extension</a> . So far I only have a Spanish translation for testing purposes in <code>&lt;Resource&gt;.es.resx</code> file . At design time translations work . So I guess I'm on the right track . </p>
  
  <p>I have included menu items to translate the GUI dynamically at run time . Initially I tried this (naïve) command ...</p>
  
  <pre><code>public class CmdTranslateUI : ICommand
  {
      bool ICommand.CanExecute(object parameter)
      {
          // TODO: Query available translations
          return true;
      }
  
      public event EventHandler CanExecuteChanged;
  
      void ICommand.Execute(object parameter)
      {
          LocalizeDictionary.Instance.Culture = new CultureInfo(
              (string) parameter);
      }
  }
  </code></pre>
  
  <p>... and menu items for each language are bound to it in XAML this way . </p>
  
  <pre><code>&lt;MenuItem Header="Español" CommandParameter="es-ES"&gt;
      &lt;MenuItem.Command&gt;
          &lt;l:CmdTranslateUI /&gt;
      &lt;/MenuItem.Command&gt;
  &lt;/MenuItem&gt;
  </code></pre>
  
  <p>The fact is that such approach is not working . Culture info remains set to <code>"en-US"</code> anyway . I read that on setting <code>LocalizeDictionary.Instance.Culture</code> its <code>DictionaryEvent</code> is triggered, so I thought this would update the GUI automatically . Obviously I'm wrong .</p>
  
  <p>On the other hand , it seems current thread's culture won't influence library behavior either.</p>
  
  <p>So I ask ... </p>
  
  <p>Q: </p>
  
  <ul>
  <li>What's the recommended approach to translate a window at run time with <a href="http://wpflocalizeextension.codeplex.com/" rel="nofollow">WPF Localize Extension</a> ?</li>
  <li>How could I list available translations ?</li>
  </ul>
  
  <p>Thanks in advance .</p>