3

enter image description here

Here's the situation:

I've got 3 textboxes where one put First Name, Last Name and Age respectively. Label with big red "!" shall be only visible when:

Any of the textboxes has no content OR Age (third textbox) is a negative number OR Age is bigger than int.MaxValue.

I already got two validation rules (one for first/last name and another for age). What do I do now? Do I need some kind of converter that checks all three input fields and returns true/false? How to implement this in XAML?

1
  • Are you using MVVM or just doing this in the code behind? Commented May 6, 2014 at 17:32

1 Answer 1

1

You can use IDataErrorInfo to validate the fields - see this article which explains how to use it. You'll just need to adapt it to have one field displaying errors instead of individual ones for all three.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.