public override ValidationResult Validate(object value, CultureInfo cultureInfo) { GeneralName generalName; if (GeneralName.TryParse(value.ToString(), out generalName)) { return(new ValidationResult(true, "")); } else { return(new ValidationResult(false, "Not a valid Name")); } }
public override ValidationResult Validate(object value, CultureInfo cultureInfo) { GeneralName generalName; if (GeneralName.TryParse(value.ToString(), out generalName) && !ServiceLocator.Instance.TeamService.NameExist(generalName.Value)) { return(new ValidationResult(true, "")); } else { return(new ValidationResult(false, "Not a valid Name")); } }
private void serieName_TextChanged(object sender, TextChangedEventArgs e) { if (string.IsNullOrWhiteSpace(serieName.Text)) { nameIsValid = false; } else { GeneralName result; if (GeneralName.TryParse(serieName.Text, out result)) { nameIsValid = true; } else { nameIsValid = false; } } ToggleCreateMatchScheduleButton(); }