In WPF, what is the difference between x:Key
and x:Name
? In which cases should one or the other be used?
I know it x:Key
can be set with one markup-extension
like this:
x:Key="{x:Static local:MisKeys.MiKey}"
But x:Name
no. Why is this? I don't like to hardcode strings
and with x:Name
that I am forced to do it.
I would like to know if both properties are "interchangeable" in some context, because I prefer to use x:Key
everything possible since I can set it with a constant.