wpfperformance

WPF Performance when using frozen Brushes as resource


The Brushes declared as resources in XAML are 'unfrozen' by default. For our application we have used a tool which generates styles for all the common controls. But I found that it is also declaring a lot of Brushes (SolidColor, LinerGradient etc.) in resource dictionary which is used by our application.

Is marking them as 'frozen' more performant?


Solution

  • Yes. See the suggestion from Microsoft in this article

    A sample from their analysis: