title: Binding Combobox with Dictionary object, but setting selected value in code behind not taking effect
body: <p>Here is my <code>ComboBox</code> instantiated in the XAML</p>
  
  <pre><code>&lt;Combobox ItemsSource="{Binding Path=Delimiters}" DisplayMemberPath="Key"
            SelectedValue="{Binding Path=SelectedDelimiter, UpdateSourceTrigger=PropertyChanged}" /&gt;
  </code></pre>
  
  <p>Here is the corresponding bindings in the view model with the <code>Dictionary</code> populated in the constructor:</p>
  
  <pre><code>private IDictionary&lt;string,string&gt; _delimiters;
  
  public IDictionary&lt;string,string&gt; Delimiters
  {
     get{return _delimiters;}
     set{_delimiters = value;  RaisePropertyChanged("Delimiters");}
  }
  
  private KeyValuePair &lt;string, string&gt; _selectedDelimiter;
  public KeyValuePair &lt;string, string&gt; SelectedDelimiter
  {
      get{return _selectedDelimiter;}
      set{
         if(value.Key != _selectedDelimiter.Key || value.Value != _selectedDelimiter.Value)
         {
             var prevDelimiter = _selectedDelimiter;
             _selectedDelimiter = value;
             if(IllegalDelimiter.Contains(_selectedDelimiter)
             {
                   MessageBox.Show("errror", "error");
                   _selectedDelmiter = prevDelimiter;
             }
             RaisePropertyChanged("SelectedDelimiter");
         }
  
      }
  }
  </code></pre>
  
  <p>I am having trouble with binding the selected value back. The <code>Dictionary</code> is getting bound and when I make a changed to the UI <code>ComboBox</code>, the setting is being fired correctly. In the if statement to check if its an illegal delimiter, it does set the selected value back to its original value in the code behind, but it doesn't populate to the <code>ComboBox</code> UI (I see the get accessor firing from the UI). Its like setting <code>SelectedValue</code> doesn't really do anything to the UI.</p>
  
  <p>if someone could point me in the right direction?</p>