コード例 #1
0
ファイル: MyService.xaml.cs プロジェクト: Gilanboy/Khorshid
        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);
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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);
            }
        }