WPF ComboBox 模糊查询+下拉自动展开时设置:
xml设置ComboBox属性 IsEditable="True",IsTextSearchEnabled="False",
模糊查询使用键盘事件如 KeyUp查询结果刷新下列选项
private void comboBox_KeyUp(object sender, KeyEventArgs e)
{
ComboBox comboBox = sender as ComboBox;
this.ViewModel.UpdateComboBoxItems(comboBox.Text); //刷新下拉选项
if (this.ViewModel.ComboBoxItems.Count > 0)
comboBox.IsDropDownOpen = true;
TextBox textBox = (TextBox)comboBox.Template.FindName("PART_EditableTextBox", comboBox);
textBox.SelectionStart = textBox.Text.Length;
}