Csla.NameValueListBase<K,V> for Windows Forms or safe for WPF

Csla.NameValueListBase<K,V> for Windows Forms or safe for WPF

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


Jaans posted on Saturday, May 31, 2014

Hi

Context: Given that BusinessBindingListBase<T,C> is for supporting Windows Forms under CSLA 4, and BusinessListBase<T,C> is the Xaml (ObservableCollection) equivalent, then what about NameValueListBase<K,V> ?

It is derived from the Csla.Core.ExtendedBindingListBase<T> type, so it would seem to be intended for supporting Windows Forms?

If that is indeed correct what is the WPF/XAML/ObservableCollection equivalent, or is it safe for usage with the XAML binding?

Thanks,
Jaans 

ajj3085 replied on Saturday, May 31, 2014

Since the NVLB is a special kind of read only list and not editable, I believe it should be fine for use with Xaml, much like there is not a separate base for ROL to use between WinForms and Xml.

Jaans replied on Sunday, June 01, 2014

Hi Andy

Actually there is a different base class for Read Only Lists for use in WinForms vs. Xaml.

WinForms should use : Csla.ReadOnlyBindingListBase<T,C>
Xaml (or more accurately ObserverableCollection consumers) should use: Csla.ReadOnlyListBase<T, C>

It because of this that I'm questioning NameValueListBase - it seems to have been missed in the base class split..

Disclaimer: Unless I've got it all very wrong that is.

ajj3085 replied on Sunday, June 01, 2014

Hmm, so there is a ROBLB.  I wouldn't have thought so, since the list and items in the list don't change so whether or not the list is the WPF one or BL I wouldn't expect to matter.  That said, have you tried it?  I image if a separate one were needed, it'd have been created by now.  that or maybe NVL doesn't get much use. :)

JonnyBee replied on Monday, June 02, 2014

There is other reasons for that too.

SortedBindingList and FilteredBindingList should work as expected for both editable and readonly lists in WinForms.

At least for WPF there is some support for BindingList lists but sorting only works with ObservableCollection. 

NameValueListBase is intended for readonly data the should not need sorting/filtering and thus there is no need to have different versions/base classes. 

Copyright (c) Marimer LLC