Ejemplo n.º 1
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            DataGrid_Main.DataContext = CustomerItems;

            var context = new KhorshidContext();

            CustomerItems.Clear();
            context.Customers.ToList().ForEach(c => CustomerItems.Add(c));

            SearchBox.Focus();
        }
Ejemplo n.º 2
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);
            }
        }