开发者

How can I improve Silverlight binding performance?

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 t开发者_如何学JAVAo 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!


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜