Wednesday 15 April 2015

wpf - Issues With ItemsContainerGenerator and Recycling -


It seems that I'm not able to understand this problem well on the Internet, so I'm asking you guys I would like to know what is the difference between using the item container generator within the custom panel method without recycle the container.

My guess is that the generator creates new containers and adds them once to the data item GenerateNext is called, but does the generator always add items to the way it is used to generate their containers? I mean, as always connecting containers, does it link the containers that have already been created / realized in their data items?

What if I start a recycling container by calling the Recycle (method) method. Will the generator still always link the containers to the items?

I am asking because the scrolling display depends on it. If the generator always adds items to containers, it will mean that it refreshes datacentext / binding and scrolling will be a little less. Although using the recycle method the generator closes the fresh binding, scrolling runs very smoothly.

When you use recycling virtualization mode, the containers are reused, so they Neither can necessarily be associated with its original data object. So if your container template contains elements that will recreate your view tree in the data (or its type or properties) - they will do the improvements to the performance, I can suggest you to make the data change independent of the template , Because it is possible, minimize the visual tree. In addition you can modify your ClearContainer method to reset some global values ​​that are not based on the data: this may be a reference to some large parent controls, settings - which is usually stable, But the visual tree affects the change on the tree.

No comments:

Post a Comment