Improve WPF Rendering Performance (WrapPanel in ItemsControl)

Posted by Wonko the Sane on Stack Overflow See other posts from Stack Overflow or by Wonko the Sane
Published on 2010-03-18T18:38:00Z Indexed on 2010/03/18 18:41 UTC
Read the original article Hit count: 1137

Filed under:
|
|

Hello All,

I have an ItemsSource that appears to have poor performance when adding even a fairly small ObservableCollection to it.

The ItemsPanel is a WrapPanel, and the ItemTemplate is essentially a Border containing another Border painted with an ImageBrush. The ItemsControl is wrapped inside a ScrollViewer.

After some investigation using WpfPerf, it would appear that most of the "what the heck is it doing?" time is spent on WrapPanel.Measure after creating the collection that is being bound. As I've mentioned, it's a fairly small collection - generally less than 100 items.

If nothing else, I'd like to be able to put a "Please Wait" on the screen (during the collection creation portion as well), but I am not sure how to know when the rendering is complete.

Any thoughts would be greatly appreciated!

Thanks, wTs

© Stack Overflow or respective owner

Related posts about wpf

Related posts about rendering