views:

153

answers:

2

Scenario:

I have many (potentially dozens) of ObservableCollection's being bound to ListBoxes at load time. These bindings are declared in their respective Xaml files. When the app first runs, it queries a database and then populates these ObservableCollections (by adding a new entity to their respective collection).

I suspect that the fact that im adding elements to a data-binded ObservableCollection is a performance concern.

The side effect is that when the app initially runs, there are hiccups (brief moments of UI-freezes). I would like to eliminate as much of these hiccups as possible.

Any insights and gotchas and tips...etc are much appricated. Thanks in advance!

+1  A: 

Here are a few tips:

If you don't do the data binding until after the data is initially loaded, it will be faster.

If you don't make the bound UI elements visible until the data is loaded, it should be faster.

If you make the binding source properties on your objects DependencyProperties, it might be faster.

Gabe
A: 

Make sure you don't use two-way data binding. If the data in the lists is static over the lifetime of the app on the client, you can even consider one-time obver one-way.

GreenIcicle