There are plenty of tips and tricks online, but here are some tactics that might help you to enhance and improvise your WPF application development techniques.
1 Enable Container Recycling
ItemsControls are the most certain to trouble your application, reason – they are not virtualized. This means that they are continuously being created and are destroyed for each and every item in the control. You can rather use the VirtualizingStackPanel as the items host, make use of VirtualizingStackPanel.IsVirtualizing and set VirtualizationMode to ‘recycling’ so that the item containers can be reused instead of creating new ones all the time.
2 Dispatch Expensive Calls
3 Choose StaticResources Over DynamicResources
4 Reduce Visuals
5 Freeze The Freezables
6 Use StreamGeometries
Use the StreamGeometries instead of PathGeometries whenever possible to draw complex 2D geometries. They are way more efficient, consume lesser memory, and enhances performance.
7 Lower the BitMapScalingMode
WPF application development by default uses a high-quality image re-sampling algorithm which consumes a lot of system resources which later on result in frame rate degradation and affect the animations badly, cause them to stutter. To improvise your performance, set the BitMapScalingMode to LowQuality and witness a ‘speed-optimized’ algorithm instead of ‘quality-optimized’ algorithm.