AC.AvalonControlsLibrary.Controls.YearValidation.Validate C# (CSharp) Method

Validate() public method

Validation for the year
public Validate ( object value, System cultureInfo ) : System.Windows.Controls.ValidationResult
value object The year value
cultureInfo System The culture info
return System.Windows.Controls.ValidationResult
        public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
            int year;
            if (int.TryParse((string)value, out year))
                if (year > 0 && year <= 9999)
                    return new ValidationResult(true, null);
            return new ValidationResult(false, null);