Reputation: 135
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,
Upvotes: 0
Views: 125
Reputation: 30830
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
.
Upvotes: 1
Reputation: 28541
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.
Upvotes: 0