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,574 other followers

.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> :)


via: Databinding Collection Properties » Danny Thorpe.

2 Responses to “.NET WPF Databinding to Collection Properties » Danny Thorpe”

  1. Thanks Jeroen! I have a feeling I’ll be blogging about more WPF discoveries…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: