private void SearchTextBox_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { TextBox tb = sender as TextBox; string result = Identify.SearchSimilarityAnalysis(tb.Text, vieModel.MovieIDList.ToList()); //相似度分析 if (result != "") { for (int i = 0; i <= IdListBox.Items.Count - 1; i++) { if (IdListBox.Items[i].ToString().ToUpper() == result.ToUpper()) { IdListBox.SelectedItem = IdListBox.Items[i]; IdListBox.ScrollIntoView(IdListBox.Items[i]); break; } } } } }