开发者

ListView with two views

开发者 https://www.devze.com 2023-01-29 05:21 出处:网络
In our application we have a scenario where we want to display the search result. The search result can be displayed as a list or detail view. we are using listview for this as listview by default use

In our application we have a scenario where we want to display the search result. The search result can be displayed as a list or detail view. we are using listview for this as listview by default uses UI virtualization.

My 开发者_如何转开发question here is how can we improve performance of our application? 1)keeping single list control with two deifferent views. 2)Using two Listview control and binding there visibility property.

Using first option i have observed if the search records increases above 1000 it takes lots of time to switch between list and detail view.

for the second option i have to do the same binding and set the visibility property.

please suggest which approach to use or is there something else better then this which we can use in this scenario.

Thanks,


Use the second option.

Users usually accept the fact that when they try to change a view, view might reset.

So, don't fill data into the other ListView until it is to be shown to user.

And Marvin is right, it is not a good idea to load a lot of data into view at the same time. To prevent that, use Virtualization.


Question is: do you really need to show all 1000 elements in the view? One possible optimisation could be simply to load a 100 of them at a time, then when the user reaches the end of the view, load another 100 results.

0

精彩评论

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