title: WPF/Silverlight AutoCompleteBox with ability to add new values to list
body: <p>I would like to use autocompletebox with a list of values, but also add new values to the list if a user enters one that isn't present.</p>
  
  <p>I currently have a string property in my view model called 'Comment'. Currently this is bound to a textbox in the view - user types a comment and the view model is updated. Simple.</p>
  
  <p>To save time, my customer would like it to autocomplete from previous values, so the way I thought to do this is something like:</p>
  
  <p><strong>ViewModel</strong></p>
  
  <pre><code>public string Comment;
  public ObservableCollection&lt;string&gt; CommentsList { ... }
  </code></pre>
  
  <p>(populate the CommentsList when the viewmodel is created)</p>
  
  <p><strong>View</strong></p>
  
  <pre><code>&lt;AutoCompleteComboBox ItemsSource="{Binding CommentsList}" SelectedItem="{Binding Comment, Mode=TwoWay/&gt;
  </code></pre>
  
  <p>So when the user selects a value, it saves the value in the Comment property. This works fine if the user selects an item in the list, but if the user types in a new value, the comment property is not updated (it is null because the selected item was not in the list).</p>
  
  <p>Is this possible with autocompletebox?</p>
  
  <p>Thanks in advance,
  Will</p>