private void ChecksforDigits(object sender, RoutedEventArgs e) { //ValidationErrorEventArgs q; ValidationErrorEventArgs l = e as ValidationErrorEventArgs; TextBox a = sender as TextBox; if ((HasNumber.hasNumber(a.Text.ToString()))) { ////e.Handled = false; //// e Name can't contain digit"; //l = null; //validation_Error(a, l); // errorMessages.Add(l.Error.Exception.Message); a.IsReadOnlyCaretVisible = true; this.AddContractbutton.IsEnabled = false; } else { // errorMessages.Remove(l.Error.Exception.Message); this.AddContractbutton.IsEnabled = true; a.IsReadOnlyCaretVisible = false; } }
public HasNumberUnitTests() { _rule = new HasNumber <string>(); }