Dirty aware

Dec 29, 2010 at 2:04 PM

Hi!

I’m trying to implement a dirtyaware feature in my Silverlight app. That is, I want to detect if something has changed in the model. I want to show this to the user by putting a star next to the name of the changed object much in the same way that Visual Studio puts a red dot in the tab of changed documents. But I’m not sure how to go about it. Does Caliburn offer some functionality to handle this?

Does EventAggregator solve the problem or is there a design pattern for these sorts of problems?

Thanx
/Mike

Coordinator
Dec 29, 2010 at 2:12 PM

There's nothing specifically in CM for dirty tracking. Normally I create a Screen class with an IsDirty flag. Then in the View for that Screen, I binding the visibility of the red dot to the IsDirty flag. How the IsDirty flag changes is the real issue. I made some comments on your other post to that effect, but it's hard to answer because it tends to be very application specific.

Dec 30, 2010 at 1:05 PM

Yes, that is #3 and it solves the problem but the code gets quite messy. Child actually has its own children and so on. But if there is no super clean standard solution this works fine.

Thanx
/MIke