Possible Bug ViewModelBase Not Setting Properties

Possible Bug ViewModelBase Not Setting Properties

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


rnb posted on Monday, June 14, 2010

Hi,

I encountered a bug working with CSLA Light 3.8 and I tested on the 4.0 beta as well.

If I have an ERL as a model, removing the first child does not mark the view model's CanSave property.  The second one triggers the CanSave though, but I suspect it is from the first change.

It does not seem to be the case with ECL because the root object's BusinessBase.OnAddEventHooks(IBusinessObject child) method registers the INotifyCollectionChanged and fires the proper notifications to the ViewModelBase.  Not in ExtendedBindingList<T>.OnAddEventHooks(T item) though, not sure if this is by design or not.

Anyways if someone can confirm this, or point out my mistake, that would be awesome.

Sample test project attached.

Thanks.

 

RockfordLhotka replied on Monday, June 14, 2010

Yes, this is a bug. I found it about a week ago in CSLA 4 - but the ViewModelBase code is pretty much the same in 3.8. I'll fix it in 3.8.4 (if I haven't already).

Copyright (c) Marimer LLC