Posts

Showing posts from February 20, 2011

Performance Tips of WPF

WPF (Windows Presentation Foundation) provides a very easy way to develop rich user experiences. A drop shadow for example can added by inserting two simple lines of XML. But this simplicity can also mislead us to overuse them. This leads to performance issues. The following tips may help you to fix or avoid them. 1. Reduce the number of visuals by removing unneeded elements, combining layout panels and simplifying templates. This keeps the memory footprint small and improves the rendering performance. 2. Lower the framerate of animations by setting Storyboard.DesiredFrameRate to lower the CPU load. The default is 60 frames/second 3. Load resources when needed. Even thow it's the most comfortable way to merge all resources on application level it can also cost performance by loading all resources at startup. A better approach is to load only often used resources and load the other on view level. 4. Enable Container Recycling. Virtualization brings a lot of performance