CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

IsModified oddities: Removing an item from a BusinessListBase

rated by 0 users
Answered (Not Verified) This post has 0 verified answers | 5 Replies | 0 Followers

Top 100 Contributor
71 Posts
dagware posted on Mon, Jul 30 2012 11:54 AM

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?

Thanks.

Dan

All Replies

Top 10 Contributor
1,813 Posts

Hi,

There's nothing called IsModified in CSLA. Is this your own implemented property or are you referring to the IsDirty flag?

Jonny Bekkum, Norway CslaContrib Coordinator

Top 100 Contributor
71 Posts

Sorry - I meant IsDirty. One of those days...

Top 10 Contributor
1,813 Posts
Suggested by JonnyBee

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.

Jonny Bekkum, Norway CslaContrib Coordinator

Top 100 Contributor
71 Posts

Hard to argue with that! :)

Thanks.

Top 100 Contributor
71 Posts

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!

Dan

Page 1 of 1 (6 items) | RSS

Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems