Terrible performance of custom-drawn control

This a kind of task WPF is not very good at. I mean vector graphics in general. Thanks to the retained mode. It’s good for controls rendering, but not for the busy graphs which you update a lot. I struggled with the same problem trying to render GPS tracks on a WPF map.

I’d suggest using direct2d and hosting it in WPF. Something like that:
http://www.codeproject.com/Articles/113991/Using-Direct-D-with-WPF

That will give you high performance.

PS Don’t get me wrong. There is nothing bad with WPF. It is designed to solve specific problems. It’s very easy to compose controls and build impressive UIs. We take a lot for granted from the automatic layout system. But it cannot be clever in every situation possible and Microsoft didn’t do a great job explaining the situations, where it’s not a good option. Let me give you an example. IPad is performant because it has the fixed resolution and an absolute layout. If you fix the WPF window size and use canvas panel you’ll get the same experience.

Leave a Comment