开发者

Databinding & performances : is the cost of a databinding high?

开发者 https://www.devze.com 2023-03-04 16:15 出处:网络
I am designing a very simple C# WPF application, following the MVVM pattern, with a ListView showing around 10 items (bound to an object containing an application\'s details) with a Checkbox, allowing

I am designing a very simple C# WPF application, following the MVVM pattern, with a ListView showing around 10 items (bound to an object containing an application's details) with a Checkbox, allowing the user to select some applications, and then click on the button "Launch".

This application is aiming at specific users of the company (an investment bank) who always have a lot of extremely heavy applications launched (real-time financial softwares, i.e. Bloomberg for example).

While my application is perfectly smooth on my PC & the IT team members' PCs, I started deploying the app to end-users and exper开发者_如何学Cienced a kinda bad situation: one click, really, just one, on an item, takes around 2 seconds to activate a CheckBox.

They are already using a basic Winforms application which is perfectly smooth for this kind of actions.

I am therefore asking myself a question, which would seem quite stupid according to the fact that DataBinding is the core of MVVM, but is DataBinding implying a higher cost than EventListeners?

Thanks!


I worked on a VoIP application that had to mantain a huge contact list and each contact had several information shown on his contact card (basically a ListBoxItem),that were changing with an high frequency. We did experience some issues but not as bad as you say. Two things come to my mind: - how many bindings do you have and how many NotifyPropertyChanged are generated? It might happen that for one property that changes in your model you generate too many events (just a possibility) - you speak about clicking a CheckBox. What happens in your setter? How heavy is it? Can you use an async operation? Sometimes it can get tricky to use controls like checkboxes and push buttons if the action they trigger can take a long time.

Just my 2 cents.

0

精彩评论

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