I'm having a little trouble here, I have a WPF application that have been running without any problems for several years. Now Microsoft have pushed out an update to windows 7, that results in the below error in the application.
System.Windows.Markup.XamlParseException: Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception. ---> System.ArgumentException: Item has already been added. Key in dictionary: 'ControlBrush' Key being added: 'ControlBrush'
This seems to suddenly be triggered by the following code
<TreeView.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
</TreeView.Resources>
Used for overriding default style in several windows. I guess I can't get Microsoft to change their update, so I have to update my code to somehow handle this problem. Do anybody have a suggestion for a work around, change of code, that could solve this problem ?
Just to clarify, the code haven't changed the last month and have been running fine, after two windows 7 pc's have been updated they both started showing this behavior.
Update
It seems to be for the treeview component, the problem exists.
Update 2
The update causing the issue is kb4520406 which is a .Net update (preview version)