Skip to content

Control's Custom Validations (CalendarDatePicker) #17876

Answered by timunie
Lonnewolf46 asked this question in Q&A
Discussion options

You must be logged in to vote

works perfectly on my end. Maybe debug into EsFuturo ?

Only change I did additinally is

-   public static ValidationResult ValidateBirth(DateTime? date, ValidationContext context)
+   public static ValidationResult? ValidateBirth(DateTime? date, ValidationContext context)
    {
        MainWindowViewModel instance = (MainWindowViewModel) context.ObjectInstance;
        if(date == null)
        {
            Console.WriteLine("Null, nothing to check");
            return ValidationResult.Success;
        }

        if (date.Value > DateTime.Today)//EsFuturo is basically a boolean on date > DateTime.Now;
        {
            Console.WriteLine("Returning error");
            return new Vali…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Lonnewolf46
Comment options

@timunie
Comment options

Answer selected by Lonnewolf46
@Lonnewolf46
Comment options

@timunie
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants