public CustomerInfoSearch(ICollectionView filteredList, TextBox textEdit)
        {
            string filterText = string.Empty;

            filteredList.Filter = delegate(object obj)
            {
                if (String.IsNullOrEmpty(filterText))
                {
                    return(true);
                }
                ModelCustomer str = obj as ModelCustomer;
                if (str.UserName == null)
                {
                    return(true);
                }
                if (str.UserName.ToUpper().Contains(filterText.ToUpper()))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            };
            textEdit.TextChanged += delegate
            {
                filterText = textEdit.Text;
                filteredList.Refresh();
            };
        }
 /// <summary>
 /// Add new Customer
 /// </summary>
 /// <param name="obj"> No parameter need</param>
 private void newCustomer_Click(object obj)
 {
     this.CustomerNew.IsEnabled = false;
     Mouse.OverrideCursor = Cursors.Wait;
     try
     {
         ModelCustomer newCustomer = new ModelCustomer();
         newCustomer.JoinDate = DateTime.Today;
         (this.CustomerList.ItemsSource as ObservableCollection<ModelCustomer>).Add(newCustomer);
         this.CustomerList.SelectedIndex = this.CustomerList.Items.IndexOf(newCustomer); 
     }
     catch (Exception ErrorException)
     {
         LogFileWriter.ErrorToLog("New Customer Click", ErrorException);
         DXMessageBox.Show(ErrorException.Message, CvVariables.ERROR_MESSAGES[0, 0], MessageBoxButton.OK, MessageBoxImage.Error);
     }
     finally
     {
         Mouse.OverrideCursor = null;
         this.CustomerNew.IsEnabled = true;
     }
 }