Question: What is the difference between x:Key and x:Name in WPF?

Answer: 
x:Key is only valid inside a resource dictionary and is added to a dictionary, x:Name is used locally and represents a variable within the class.
Yes, you would use x:Key to assign a key to resources inside a ResourceDictionary, either locally in the resources section for an element or a specific ResourceDictionay. This key is then used to look up the resource, through {DynamicResource XXX} or {StaticResource XXX}. 

x:Name is used to assign a name to a control in xaml. This can then be used to access the element in the code behind file, using the usual syntax or using an ElementName binding inside the file.