Xaml
is parsed left to right so I think its checking the ResourceDictionary
or the other MergedDictionaries
if the TargetType
(default identifier if no x:Key is used) exists before it realizes it has an x:Key
identifier
Try setting the x:Key
before the TargetType
.
this could be a bug in the Xaml parser or it could be by design, It may be worth a look on Microsoft Connect