private void SearchBox_TextChanged(object sender, TextChangedEventArgs e) { KhorshidContext.Services.Load(); DataContext = Service = new ObservableCollection <Service>(KhorshidContext.Services.Where(c => c.DriveName == driver).ToList());; var ctr = (TextBox)sender; if (ctr.Text == "") { return; } SearchEngine.ApplySearchOnCollection(ctr.Text, Service); }
private void SearchTextBox_ApplyModification() { if (SearchBox.Text.Trim()?.Length == 0) { Context.Clear(); KhorshidDataManager.GetModifiedTownData().ForEach(town => Context.Add(town)); } else { string term = SearchBox.Text.Replace("آ", "ا"); SearchEngine.ApplySearchOnCollection(term, Context); } }
private void SearchTextBox_ApplyModification() { if (SearchBox.Text.Trim()?.Length == 0) { var context = new KhorshidContext(); CustomerItems.Clear(); context.Customers.ToList().ForEach(c => CustomerItems.Add(c)); } else { string term = SearchBox.Text.Replace("آ", "ا"); SearchEngine.ApplySearchOnCollection(term, CustomerItems); } }