INotifyCollectionChanged Silverlight

INotifyCollectionChanged Silverlight

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


greengumby posted on Wednesday, April 08, 2009

Hi,

I vaguely remember something about the INotifyCollectionChanged interface being removed from CSLA, just wondering if that included Silverlight.

If it is removed does that stop the ability to update the model's properties and expect the UI to reflect the changed values?

Cheers
Jeremy

 

 

RockfordLhotka replied on Wednesday, April 08, 2009

The INotifyCollectionChanged interface wasn't "removed" exactly. It conflicts with the older IBindingList interface, because both interfaces define a changed event.

Web Forms and Windows Forms know nothing about INotifyCollectionChanged of course, because it was introduced by WPF. If you want objects that work with WPF and with Web Forms and Windows Forms, then you must stick with IBindingList. Since CSLA supports all these technologies, the choice is clear.

Silverlight is a different story, because it isn't .NET and doesn't have the .NET history. Due to this, there is no IBindingList in Silverlight, and no need to worry about supporting it even if there was such a thing. So the collection base types in CSLA .NET for Silverlight do implement INotifyCollectionChanged, because that's the interface that makes sense on the Silverlight platform.

The whole point, at the end of the day, is to have CSLA support all the odd-ball data binding interfaces so you don't have to, and for the most part that's the case today.

However, if you look back through the forum a month or so, you'll find a thread I started to discuss the very real conflict between WPF and the rest of .NET in terms of collections. To really work nicely with WPF, your collection can't work with the other technologies, and visa versa. That's nasty, and it is unfortunate that Microsoft put us in this position...

And that's in addition to the fact that WPF interprets PropertyChanged differently, and it interprets Equals() differently. The PropertyChanged difference is annoying, but they actually are doing the right thing (and the older technologies do the wrong thing). But the Equals() issue is a total PITA, and I think they are fundamentally wrong in how they use it.

greengumby replied on Monday, April 20, 2009

Thanks Rocky for you in-depth reply. I checked out the thread discussing this problem and now have understanding of issues.

It seems a pity because I really liked the idea of one CSLA handling SL/WPF/WinForms/Web scenarios.

While I like the concept of CSLA handling all in reality I believe CSLA foremost needs to handle all new technology. If that means dropping WinForm support then so be it.

Rocky on another off topic question. Im from Perth, Australia (GMT +8) and notice that your forums go down at around 2pm to 4pm everyday. Is this normal?

Thanks
Jeremy


ajj3085 replied on Monday, April 20, 2009

greengumby:
Rocky on another off topic question. Im from Perth, Australia (GMT +8) and notice that your forums go down at around 2pm to 4pm everyday. Is this normal?


IIRC, the server is offline to backup. It's a virtual server... again IIRC.

RockfordLhotka replied on Monday, April 20, 2009

My servers are hosted on a machine that does a daily backup - at around 3 AM
my time. Unfortunately this means the servers are offline every day for a
period of time.

While that is inconvenient, and I am sorry about that, the hosting is free
and so I can't argue with the price. I've had some people get quite
irritated - even heated - about this issue. And if someone is irritated
enough to cover the cost of using a different hosting setup I'm perfectly
happy to switch :)

Rocky

Copyright (c) Marimer LLC