Question

This is the scenario: To display lots of UIElements in a Panel.

Since the number of these controls might be large, I am worried about memory allocation and performance issues.

Visualization is an option, But I hope to be able to do better, because the goal is to just display the content of these controls and there is no need to handle Mouse or Keyboard events.

Is there any way to improve performance in this scenario?

Thanks.

Was it helpful?

Solution

You can just use a normal ListBox to display them, the default panel is the VirtualizingStackPanel which has IsVirtualizing property set to true by default.

VirtualizingStackPanel

Are you currently running into performance issues or preparing for them in case they happen? I would only worry about performance after you've generated and displayed all of your content and noticed problems.

Here is an article with some examples of how to manage large data sets and virtualization: http://www.codeproject.com/Articles/34405/WPF-Data-Virtualization

OTHER TIPS

You say Visualization... I'm assuming maybe you mean Virtualization? If so, then you may or may not know about this website: http://msdn.microsoft.com/en-us/library/cc716879.aspx

Besides Virtualization, they also talk about deferred scrolling. I hope this helps.

I think these should help you:
1. Optimize Layout and Design
2. Optimize Text
All other useful links about performance can be found here: http://msdn.microsoft.com/en-us/library/aa970683.aspx but I think 2 above links will work well in your case.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top