private void Page_Loaded(object sender, RoutedEventArgs e) { DataGrid_Main.DataContext = Context; Context.Clear(); KhorshidDataManager.GetModifiedTownData().ForEach(town => Context.Add(town)); SearchBox.Focus(); }
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); } }