CSLA .NET

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

MobileBindingList.OnSetChilderen() Deserialization/RaiseListChangedEvents

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

Top 100 Contributor
77 Posts
Peran posted on Thu, Jun 21 2012 11:08 AM

Hi Rocky/Jonny,

I'm using the recommended practice of using SuppressListChangedEvents in my ObjectFactory when loading data from my DB into a BusinessListBase/ReadOnlyListBase.

I was surprised to notice that when the object is deserialized on the client the same pattern is not followed, an event is raised for every item added to the collection during deserialization (MobileBindingList.OnSetChilderen() when deserializing $list).  Is this behavior expected?  I think it would also impact n level undo?

For my case I added a workaround to my BusinessListBase/ReadOnlyListBase base classes:

 

protected override void OnSetChildren(Csla.Serialization.Mobile.SerializationInfo info, Csla.Serialization.Mobile.MobileFormatter formatter)

{

    // prevent list change events whilst deserializing

    using (this.SuppressListChangedEvents)

    {

         base.OnSetChildren(info, formatter);

    }

}

 

If the behavior is not expected I can investigate a suitable fix within csla.

What do you think?

 

Peran

 

All Replies

Top 10 Contributor
9,270 Posts

Peran,

It is not expected, but it is a known bug. I believe there's already an issue for this, and if you'd like to dig into it that'd be great!

Rocky

Top 100 Contributor
77 Posts
Peran replied on Mon, Jun 25 2012 3:47 AM

Ok, I'll have a look into it.

 

Peran

 

Page 1 of 1 (3 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