I've come across a peculiar situation (CSLA 4.3.13, WPF 4). Let's say I have a parent BusinessBase with children. We've just loaded the parent from the database, and IsModified is false.
We modify a child. Now the parent's IsModified is true, as it should be.
We remove the child. During this process, the parent's IsModified goes back to false, then back to true. I first noticed this because I have a "Save" button that uses animation to fade it out and back in, depending on IsModified. So in this situation, you can see the button go away and then fade back in, quickly.
Is there a good way to handle this? Some sort of way to keep IsModified returning true, during the process of removing the child item?
There's nothing called IsModified in CSLA. Is this your own implemented property or are you referring to the IsDirty flag?
Sorry - I meant IsDirty. One of those days...
And I assume that you use Csla.Xaml.ViewModelBase to make the property bindable?
(Properties like IsDirty, IsSelfDirty, IsValid will become bindable directly on the objects in Csla 4.5 with OnPropertyChanged events).
Csla.Xaml.ViewModelBase hooks into several events on the business objects in order to update all the bindable "metastate" properties. It could be that this is not the optimum solution for the IsDirty flag but it is the best we can do at the moment.
Hard to argue with that! :)
This shouldn't come as a surprise for anyone who knows me, but it turns out that I'm an idiot. I was the one who was causing the problem. Story of my life!
Copyright (c) Marimer LLC