Tracking changes to individual fields - Silverlight
- by Appu
I have a page which has got several text boxes. These controls are bound to a model. I am using MVVM.
Assume I have three text boxes, FirstName, LastName and Company. So in the model, I have three properties to bind. Now I need to track the changes happened to each field. If FirstName changes from original value, I need the text box to be colored with a different background color.
Currently I am creating another property called FirstNameChanged and binding the background to this property. This will be updated when I change the FirstName. For 3 fields, this seems to be OK. But when I have more fields, the number of properties will be too much.
Is there a better way to handle this?