Confused by Child_PropertyChanged in CSLA 3.0.4?

Confused by Child_PropertyChanged in CSLA 3.0.4?

Old forum URL: forums.lhotka.net/forums/t/5559.aspx


rsbaker0 posted on Thursday, October 09, 2008

I'm confused as to the purpose of this event handler in CSLA 3.0.4 in BLB and ERLB.

What the event handler does seems clear enough, but it only seems to be hooked in one place:

OnDeserializedHandler()

It's private, which would seem to rule out derived BLB/ERLB classes hooking it themself when the list is fetched.

What I seem to be observing is the rather bizarre situation that newly fetched BLB has objects in the list without the event hooked, but then once the list is saved (and hence deserialized), the event is now hooked for the objects in the list.

Surely I'm missing something. Can someone point me in the right direction?

 

 

danielmartind replied on Thursday, October 09, 2008

The event is also hooked up in the default constructor after the collection is created and after the collection is fetched in the dataportal. There is an example of this in the PTracker app i think.

rsbaker0 replied on Thursday, October 09, 2008

I thought I had done a text search of the entire CSLA project for references to to this event and had confirmed the reported behavior via debugging, but I'll look again.

rsbaker0 replied on Thursday, October 09, 2008

OK, I've confirmed my original results: (with CSLA 3.5.1 also now)

(1)  A newly fetched BLB child of my object doesn't have the Child_PropertyChanged() handler hooked for any of it's list objects.

(2) Changes to the properties of of list objects don't fire Child_PropertyChanged() (e.g. confirmation of #1)

(3) If object is saved, then Child_PropertyChanged() *does* get hooked as an event handler in OnDeserializedHandler()

and

(4) Child_PropertyChanged() starts firing once list object properties are changed.

I can't find references that add Child_PropertyChanged() as a handler anywhere except in OnDeserializedHandler().

I'm lost... :(

 

danielmartind replied on Friday, October 10, 2008

Normal 0 false false false EN-GB X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;} Apologies! I read your question completely differently which is why  my answer would have made no sense. Embarrassed [:$]

Now that I have read you query properly I am as stumped as you.

Dan

Copyright (c) Marimer LLC