private void ContactComboBox_OnPreviewKeyUp(object sender, KeyEventArgs e) { if (e.Key == Key.Back || e.Key == Key.Space) { ContactComboBox.IsDropDownOpen = true; var be = ContactComboBox.GetBindingExpression(ComboBox.TextProperty); be.UpdateSource(); } if (e.Key == Key.Up && ContactComboBox.IsDropDownOpen) { if (ContactComboBox.SelectedIndex != -1) { ContactComboBox.SelectedIndex = ContactComboBox.SelectedIndex - 1; if (ContactComboBox.SelectedIndex == -1) { var be = ContactComboBox.GetBindingExpression(ComboBox.TextProperty); be.UpdateSource(); } } } if (e.Key == Key.Down && ContactComboBox.IsDropDownOpen) { if (ContactComboBox.SelectedIndex < ContactComboBox.Items.Count) { ContactComboBox.SelectedIndex = ContactComboBox.SelectedIndex + 1; } } }
private void ContactComboBox_OnTextInput(object sender, TextCompositionEventArgs e) { ContactComboBox.IsDropDownOpen = true; var be = ContactComboBox.GetBindingExpression(ComboBox.TextProperty); be.UpdateSource(); }