[Required] and disable Button

Topics: Questions
Sep 16, 2013 at 2:29 PM
Question to validation:

How to disable a Button when fields with [Required] attributes are empty?
Sep 17, 2013 at 7:22 AM
You can create a command with a CanExecution method. In this method, check for this.HasErrors.
Sep 17, 2013 at 8:30 AM
Edited Sep 17, 2013 at 10:06 AM
Ok. Already tried this. But now I found the problem.

Add the attribut [Required] to an string property. Here ist works. Correct errormessage and HasErrors is true.

Add the attribut to an int property. Here it works not.

The textbox which the property is bind to has a behavior: catel:NumericTextBox.
Errormessage: "The input string was not in a correct format" instead of "The ... field is required". And also this.HasErrors is false.

PS: The tense of the both messages differs.
Sep 23, 2013 at 8:39 AM
Should I add an issue, or is there an other solution?
Sep 23, 2013 at 6:56 PM
Please create a repro yeah, but I am afraid this is part of the cost of using attribute validation.