title: wpf combobox binding is empty
body: <p>I am trying to work out wpf with some difficulties. This <code>ComboBox</code> seems a very basic issue but I can't have it populated even after reading all possible similar post.</p>
  
  <p>The extra difficulty I think is that the <code>ComboBox</code> is defined in a resource, here is the resource code:</p>
  
  <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:s="clr-namespace:DiagramDesigner"&gt;
  
  &lt;ResourceDictionary.MergedDictionaries&gt;
      &lt;ResourceDictionary Source="Styles/Shared.xaml"/&gt;
      &lt;ResourceDictionary Source="Styles/ToolBar.xaml"/&gt;
  &lt;/ResourceDictionary.MergedDictionaries&gt;
  
  &lt;ToolBar x:Key="MyToolbar" Height="120"&gt;
  
      &lt;!--Languages--&gt;
      &lt;GroupBox Header="Localization" Style="{StaticResource ToolbarGroup}" Margin="3"&gt;
          &lt;Grid&gt;
              &lt;ComboBox Height="23" HorizontalAlignment="Center" 
                        VerticalAlignment="Top"  Width="120"
                        ItemsSource="{Binding _langListString}" 
                          DisplayMemberPath="ValueString" 
                          SelectedValuePath="ValueString" 
                          SelectedValue="{Binding LangString}"
                        /&gt;
          &lt;/Grid&gt;
      &lt;/GroupBox&gt;
  
    &lt;/ToolBar&gt;
  </code></pre>
  
  <p></p>
  
  <p>My data object is defined as follow:</p>
  
  <pre><code>public partial class Window1 : Window
  {
  
      List&lt;ComboBoxItemString&gt; _langListString = new List&lt;ComboBoxItemString&gt;();
  
      // Object to bind the combobox selections to.
      private ViewModelString _viewModelString = new ViewModelString();
  
  
      public Window1()
      {
          // Localization settings
          _langListString.Add(new ComboBoxItemString()); _langListString[0].ValueString = "en-GB";
          _langListString.Add(new ComboBoxItemString()); _langListString[1].ValueString = "fr-FR";
          _langListString.Add(new ComboBoxItemString()); _langListString[2].ValueString = "en-US";
  
  
          // Set the data context for this window.
          DataContext = _viewModelString;
  
  
          InitializeComponent();
  
  
      }
  </code></pre>
  
  <p>And the modelview:</p>
  
  <pre><code>/// This class provides us with an object to fill a ComboBox with
  /// that can be bound to string fields in the binding object.
  public class ComboBoxItemString
  {
      public string ValueString { get; set; }
  }
  
  
  //______________________________________________________________________
  //______________________________________________________________________
  //______________________________________________________________________
  
  
  
  /// Class used to bind the combobox selections to. Must implement 
  /// INotifyPropertyChanged in order to get the data binding to 
  /// work correctly.
  public class ViewModelString : INotifyPropertyChanged
  {
      /// Need a void constructor in order to use as an object element 
      /// in the XAML.
      public ViewModelString()
      {
      }
  
      private string _langString = "en-GB";
  
      /// String property used in binding examples.
      public string LangString
      {
          get { return _langString; }
          set
          {
              if (_langString != value)
              {
                  _langString = value;
                  NotifyPropertyChanged("LangString");
              }
          }
      }
  
      #region INotifyPropertyChanged Members
  
      /// Need to implement this interface in order to get data binding
      /// to work properly.
      private void NotifyPropertyChanged(string propertyName)
      {
          if (PropertyChanged != null)
          {
              PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
          }
      }
  
      public event PropertyChangedEventHandler PropertyChanged;
  
      #endregion
  }
  </code></pre>
  
  <p>I just don't know what to try else. Is anyone has an idea of what is going on, and why the combobox stays empty?</p>
  
  <p>Many thanks.</p>