/// <summary> /// Method searches for and updates the list of patients based on the entered pesel number /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void txtPesel_TextChanged(object sender, TextChangedEventArgs e) { if (txtPesel.Text.Length > 0) { txtId.IsEnabled = false; txtLastName.IsEnabled = false; if (Regex.IsMatch(txtPesel.Text, "^[0-9]+$")) { ClientList.Clear(); ClientList.AddRange(client.FindByPesel(txtPesel.Text)); MyDataGridFind.Items.Refresh(); } else { txtPesel.Clear(); } } else { txtId.IsEnabled = true; txtLastName.IsEnabled = true; ClientList.Clear(); MyDataGridFind.Items.Refresh(); } }