Tag Archives: Merged dictionaries

WPF XAML Resource Benchmark

WPF is very dynamic and allows us to use resources in many different ways. We can use Static or Dynamic. We can place all our resources in App.xaml or use merged dictionaries each time.

You can see all the approaches and what I think is best practice in my WPF Merged Dictionary problems and solutions post.

If you’re new to WPF resources, I suggest reading my Explicit, Implicit and Default styles in WPF post before diving into this one.

This benchmark is supposed to show, in numbers, how any approach affects performance.
Here’s what I want answered with this benchmark:

  1. Is splitting resources in App.xaml to many Merged Dictionaries file vs. one long App.xaml file means longer application startup time?
  2. Is loading all resources in App.xaml once better than loading the resources every time with merged dictionary?
  3. Is DynamicResource instead of StaticResource an issue? How big of an issue?’

Continue reading