I am binding an int to a textbox. Is there a way to change the color of the textbox based on the binded value?
For eg. if the int if > 0, the textbox should be green, else, red.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is where you would use Value Converters, one that converters from an int to a color. You then bind the background property to the int property (as well as binding the text).
Here’s an post about them So What’s a Silverlight Value Converter Anyway?