WPF MVVM performance troubleshooting

Is your code running as fast as possible, but your WPF GUI is build up pretty slow? Well here are some tips which might help you find the problem:

  1. Check for broken bindings
    If you leave broken bindings in your XAML it will hamper down the performance of building up the GUI significantly. You can for instance follow the tips in this excellent thread on Stackoverflow on how to do that: http://stackoverflow.com/questions/337023/how-to-detect-broken-wpf-data-binding
  2. Provide fallback values
    Next to fixing broken bindings, providing fallback values when properties are null can increase performance a tiny bit. The exceptions are still thrown, but handled better. More information can be found here: http://stackoverflow.com/questions/20629915/binding-fails-silently-for-nested-property. Be carefull not to ignore broken bindings though, because that is worse than not providing fallback values, as pointed out here in the answer by Rob: http://stackoverflow.com/questions/5390198/should-i-always-use-bindingbase-fallbackvalue

As I was writing this blogpost I stumbled upon another blog with lots of great tips. Make sure to check them out at: http://www.wpftutorial.net/10PerformanceTips.html

If you are not sure about any of the tips provided by me or the wpf tutorial blog feel free to contact me and maybe I can help.

Advertisements

About Danny

Bachelor in Commercial ICT MCTS Winforms .NET 2.0 MCTS ASP.NET 3.5 PSM I
This entry was posted in WPF and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s