private void searchTextBox_OnSearch(object sender, RoutedEventArgs e)
{
var searchArgs = e as SearchEventArgs;
if (searchArgs == null) return;
if (searchArgs.Keyword == "")
{
listBox.ItemsSource = typeList;
listBox.SelectedIndex = -1;
}
else
{
listBox.ItemsSource = typeList
.Where(
x => x.Name.ToLower().Contains(searchArgs.Keyword.ToLower(), StringComparison.OrdinalIgnoreCase))
.ToList();
listBox.SelectedIndex = 0;
}
}