Here are some differences I found:
- It seems like Inspect.exe (former UISpy.exe) can only read .AutomationId, but not .AutomationName
- this two links about name and automationId might be useful as well. biggest difference from the two links: "If AutomationProperties.AutomationId is not specifically set, it returns the AutomationProperties.Name property value." this is not specified for the name property.
- If neither AutomationProperties.AutomationId nor AutomationProperties.Name are set, and in xaml the Name (not x:Name, that one doesn't work!!) is set, then the AutomationProperties.AutomationId is set to the same value as the Name Property is (be aware that I mean two differnt things with the Name (standard XAML Property) and AutomationProperties.Name!!)
If for instance the following TextBlock is used:
<TextBlock x:Name="msgStatus" Text="idle" ... />
the value "idle" of the Text Property can be accessed by AutomationProperties.Name! The same applies for reading the text of Labels. A Labels Content can also be read by the AutomationProperties.Name(if the AutomationProperties.Name is not specififed in the .xaml)!