The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,513 other followers

Archive for June 22nd, 2011

.NET WPF Databinding to Collection Properties » Danny Thorpe

Posted by jpluimers on 2011/06/22

Danny Thorpe recently wrote a very nice post on via Databinding Collection Properties in WPF that sometimes fail without warning.

The short summary is that this fails without warning when binding to properties that do not explicitly implement the IList interface, for instance when binding to a collection that supports only IEnumerable (because of yield return) or IList<T> (for instance when binding to a Dictionary<TKey, TValue>.Values, which implements IList<T>, but not IList).

Thanks Danny for blogging about this (he explains it way better than I can), and putting a warning that the workaround Dictionary<TKey, TValue>.Values.ToList() potentially can have a big impact on memory consumption.

Life would be so much easier if WPF could bind to IEnumerable or IList<T> :)

–jeroen

via: Databinding Collection Properties » Danny Thorpe.

Posted in .NET, Development, Software Development, WPF | 2 Comments »

 
%d bloggers like this: