2

Does anyone know if there is a common object that inherits from ICollectionView in both Silverlight and WPF?

Or do I just have to create my own version?

Matthew Bill
  • 203
  • 3
  • 11

2 Answers2

1

Whilst WPF has a few types that implement ICollectionView (e.g. CollectionView and ListCollectionView), the Silverlight API does not expose many types that implement this interface. This is because whilst WPF uses this interface widely, Silverlight only uses ICollectionView internally within its DataGrid control.

You can find a Silverlight collection view that implements this interface here:

http://www.scottlogic.co.uk/blog/colin/2010/03/binding-a-silverlight-3-datagrid-to-dynamic-data-via-idictionary-updated/

ColinE
  • 68,894
  • 15
  • 164
  • 232
-1

Check the PagedCollectionView. Just be sure you have a reference to System.Windows.Data.

jweyrich
  • 31,198
  • 5
  • 66
  • 97
  • it explicitly says SL3 SL4 and nothing for .NET on that msdn link. – jrwren May 16 '11 at 20:18
  • @jrwren: sorry, I don't understand your complaint. What do you mean by "nothing for .NET"? SL3 and SL4 are part of .NET. Please, elaborate. – jweyrich May 16 '11 at 20:24
  • SL3 and SL4 are not part of .NET. When I install .NET3.5 or .NET4 on my Win7 I don't have SL3 or SL4 adn I don't have PagedCollectionView. SL is a separate impl of .NET – jrwren May 23 '11 at 13:56
  • @jrwren: Right. You have to install the Silverlight SDK. Now, even if you use another language (e.g: Python) with Silverlight, you may still use the mentioned class, and still requires you to add the reference to the respective library before importing. To conclude, once you mention Silverlight or WPF, it means .NET, even if you pick another language to write your program. Am I mistaken? – jweyrich May 23 '11 at 14:30
  • You are mistaken because PagedCollectionView does not exist in .NET and WPF. All of your points are irrelevant to that. You are also just plain wrong when making statements like "once you mention Silverlight or WPF, it means .NET" This is absolutely false. The byte code is the same, but the class library diverges. – jrwren May 24 '11 at 18:52
  • @jrwren: it doesn't. It does exist in Silverlight. Indeed I can be wrong about "once you mention Silverlight or WPF, it means .NET", but I'd appreciate a reference that supports that. Please, educate me. – jweyrich May 24 '11 at 19:37