Questions tagged [resourcedictionary]

Provides a hash table / dictionary implementation that contains resources - reusable objects (e.g. vector drawings, brushes, colors, control template, data templates etc.) used by application components.

ResourceDictionary is used in XAML-oriented UI frameworks (WPF, Xamarin, Silverlight) to store various resources used by application components.

The items in a ResourceDictionary are not immediately processed when application code is loaded by a XAML loader. Instead, the ResourceDictionary persists as an object, and the individual values are processed only when they are specifically requested.

1071 questions
270
votes
7 answers

ResourceDictionary in a separate assembly

I have resource dictionary files (MenuTemplate.xaml, ButtonTemplate.xaml, etc) that I want to use in multiple separate applications. I could add them to the applications' assemblies, but it's better if I compile these resources in one single…
Gus Cavalcanti
  • 10,527
  • 23
  • 71
  • 104
68
votes
1 answer

Load WPF styles or other Static Resources from an external file or assembly

I have a few WPF applications and I want all my styles to be in a shared assembly instead of declaring them in each application separately. I am looking for a way so I don't have to change all my Style="{StaticResource BlahBlah}" in the existing…
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
55
votes
4 answers

Skinning: Using a Color as StaticResource for another Color

I implemented skinning in my application. The application loads its Brushes.xaml resource dictionary which uses colors which reside in a skin-specific resource dictionary. So only one Color.xaml is loaded depending on the chosen skin. Skin-Specific…
Amenti
  • 1,511
  • 1
  • 13
  • 29
49
votes
3 answers

How to override a global style (that doesn't have an x:Key), or alternatively apply a named style to all type-targeted controls?

I declared a style that I want to apply to ALL the buttons in the project, the style resides in the ResourceDictionary: