title: MVVM/WPF - Always show combobox drop down list when user is typing in the text box
body: <p>I want to force the drop down to open when the user is typing in the text box. </p>
  
  <p>I have logic in place to filter the list and when i do not bind anything to the IsDropDownOpen element, it seems to work as desired, except if the textbox loses focus, and then refocused, the dropdown wont come back unless i click the arrow. </p>
  
  <pre><code>&lt;ComboBox x:Name="nodeList" 
      Text="{Binding UserInput, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
      ItemsSource="{Binding NodeTokenList}" DisplayMemberPath="FullNodeName" 
      HorizontalAlignment="Left" VerticalAlignment="Top" Width="324" 
      Margin="162,49,0,0" Height="32" 
      IsDropDownOpen="{Binding Path=ShowDropDown, Mode=TwoWay, Converter= {StaticResource BoolToVis}, UpdateSourceTrigger=PropertyChanged}" /&gt;
  </code></pre>
  
  <p>Above is my xaml.</p>
  
  <p>Everytime UserInput is changed (the item source for the text), it filters the itemsource for the drop down list. I now have it so that ShowDropDown (my bool for the IsDropDownOpen)</p>
  
  <p>Here is my UserInput and ShowDropDown definition:</p>
  
  <pre><code>public string UserInput
  {
       get { return _userInput; }
       set
           {
             _userInput = value;
             FilterListOnKeyPress();
             OnPropertyChanged("UserInput");                              
           }
  }
  
  public bool ShowDropDown
  {
       get { return _showDropDown; }
       set
           {
             _showDropDown = value;
             OnPropertyChanged("ShowDropDown");
           }
  }
  </code></pre>
  
  <p>and finally here is my implementation of FilterListOnKeyPress()</p>
  
  <pre><code>private void FilterListOnKeyPress()
  {
       if (string.IsNullOrEmpty(UserInput))
       {
           NodeTokenList = BackUpNodeTokenList;
           return;
       }
       else
       {
           NodeTokenList = BackUpNodeTokenList.Where(x =&gt; x.FullNodeName.ToLower().Contains(UserInput.ToLower())).ToList();
                  ShowDropDown = true;
        }
   }
  </code></pre>