While defining style in resource dictionary you can use either
x:Name="xyz"
and
x:Type="xyz".
and can reference this style in XAML like {StaticResource xyz}.
Most examples use 'x:Key', and the difference between 'name' and 'key' is that using 'x:name' lets you use this style definition code-behind?
FIXES: The question is totally wrong. What was intended to be asked was the difference between x:Key and x:Name. But didn't go trying this code myself, but was just relying on memories - thought I have both in ResourceDictionary, which was wrong. And I also didn't have such code in
<xxx.Resources >
sections, since it doesn't work either. You can't reference Style that doesn't have x:Key (x:Name doesn't work here), and adding two styles without x:Key throws exception since both get the same (empty?) key in dictionary.
Ray puts all the difference in a very nice way, thanks.
My fault