WPF 4.5 – Part 7 : Accessing collections on non-UI Threads(www.jonathanantoine.com)

submitted by jmix90jmix90(570) 8 months, 3 days ago

Here is the seventh (OMG !) post on the WPF 4.5 new features. Collections are a part of every application and their management is maybe the first thing you learn to deal with in WPF. To begin, you put everything on the main(the UI one) thread and it works just fine. After a few time, you realize that it freezes the application UI and that the users usually don’t like it. Then you put the collections creation/feeding on another Thread to free the UI’s one and you realize that it is not possible because : “This type of CollectionView does not support changes to its SourceCollection from a thread different from the Dispatcher thread”. In this post we will discover that this is over with WPF 4.5 (and that you’ll love it) !

1 comment |category: |Views: 28

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by dpetersondpeterson(4397) 8 months, 1 day ago +1

Hmm, this approach seems to be compatible with MVVM as well. I usually handle this situation by burning memory and passing a copy of the collection back to the UI thread to update the bound collection object. This might help performance in those scenarios.

Reply

information Login or create an account to comment on this story