Situation:Window.Resources.MergedDictionaries contains AdministrationResources.xaml (ResourceDictionary)AdministrationResources.xaml contains GlobalResources.xaml in MergedDictionariesGlobalResource.xaml contains style:<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}"> ...</Style>Window contains control:<Button x:Name="OKButton" Content="OK" />What I found out:Style in GlobalResources is applied in VS designer, but not in runtime (default WPF button style is used).If style is defined in Window.xaml or in AdministrationResources.xaml it works good.If I set buttons style explicitly it works good. Even if I set it to the value of DefaultStyleKey.<Button x:Name="OKButton" Content="OK" Style="{StaticResource {x:Type Button}}" />Default style key is always set correctly to typeof(Button).Window.FindResource(typeof(Button)) works correctly.It is working code from .NET 3.5 SP1, now it does not work in .NET 4.0 supplied with VS2010 RTM.I think:When looking for style defined by DefaultStyleKey (not set explicitly), only one level of merged dictionaries is searched.
Product Language
Visual Studio Version
Operating System
Operating System Language
Steps to Reproduce
Actual Results
Expected Results