Posted 03 Oct 2013
Link to this post
So, i'm doing field check in the VM, and send message with status to the View.
However, when i'm having different Invalid messages, they are not having effect for the field message (probably due to optimization).
case 0: // Ok
case 1: // String is empty
ZipTextBox.ChangeValidationState(ValidationState.Invalid, "Cant be empty");
case 2: // String.Count != 5
ZipTextBox.ChangeValidationState(ValidationState.Invalid, "Should be Zip");
If user enters nothing, it would be 1 case, and he would get "Cant be empty" message.
Then, if he would enter 2 digits, it would be 2 case, but he would still see "Cant be empty" message.
Then, if to enter 5 digits, it would be 0 case, he would see "Ok" message;
Then, if to enter 2 digits again, it would be 2 case, and now user would see "Should be Zip" message.
As mentioned before, i assume, it is caused by optimization (if still Invalid state, dont change message), but with this scenario, it is working wrong. I guess, workaround is just to set it to ValidationState.Validating before switching.