Let's suppose, that we've got the following dictionary:
<ResourceDictionary xmlns:sys="clr-namespace:System;assembly=mscorlib">
<sys:String x:Key="Test">Ala ma kota</sys:String>
</ResourceDictionary>
This dictionary is merged somewhere in custom control:
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="MyDictionary.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
How can I completely change value of the resource "Test" during application runtime from the code behind?
If you are looking to change a resource from code behind then just access the resource like a dictionary and change desired value :)
Like this:
That would be it :)