0
votes

I'm building a WPF application to visualize a load of items (a few thousand). For this i'm using an ItemsControl of which the ItemsSource is set to a BindingList.

I've noticed that it takes some time to initialize the screen... The main bottleneck is the creation of TextBlock elements (the data template of the items contains 4 TextBlock elements). Once the screen is initialized (when all WPF elements are created), rendering is quite OK.

I've implemented zooming and panning, so i was thinking about making the appearance of the items dependent on the zoom level and the center point (a bit like Google Maps: data is only visualized for regions that are into the view).

How can this be done? Is there any way in WPF to ask the item or item container if it is currently clipped?

1

1 Answers

1
votes

You can make your list virtualized. This way only the items that are visible will have UI controls created for them. Check the ListView documentation, or this link may help: http://www.codeproject.com/KB/WPF/WpfDataVirtualization.aspx

Jogy