Set BackgroundColor of Control with PropertyStatus

Set BackgroundColor of Control with PropertyStatus

Old forum URL: forums.lhotka.net/forums/t/9416.aspx


t.kehl posted on Saturday, August 21, 2010

Hi.

Is it possible to use PropertyStatus to set the BackgroundColor of a Control when the Rule(s) of the associated Property is broken?

Thank you.

Thomas

RockfordLhotka replied on Saturday, August 21, 2010

Yes, but not by itself.

PropertyStatus exposes numerous properties like CanRead, IsValid, etc. Most of these are boolean values. You can bind to them, but if you want the resulting value to be a Color you'll need to implement a value converter to convert the bool to a Color. This is easy, and is something that is very basic to any XAML development - so if you already know what I'm talking about you are good to go. And if you don't know what a value converter is, you really need to learn - but it is so easy it is like falling off a log, and a quick internet search will give you more detail than you care to read :)X

Copyright (c) Marimer LLC