Is there a way of generating a UIMap using a WinForms source code file? (.Designer.cs)
If so, can the generated file use properties (if public) from the source? (Therefore not using hardcoded strings and generating compiler errors in the CodedUI if a control gets removed).
Generating a Designer file by generating over it will loose all your recorded actions. I would suggest you separate out your UIMap to use multiple . I've been using a T4 to generate from something similar using the CUITe framework so there is logical separation. So it will generate the 2. designer file, the 3. navigation based on that file, and possibly the Coded UI Test to call the file. such as 1. login.Designer.cs - > 2. loginPage.Designer.cs - > 3. Navigation.Designer.cs
Note: If you are using a designer file as your input, this should also be your output, so it is very clear that no one should change these files. Thus any attempt to optimize from this will have to be in a separate cs file.
so a template that you can customize to get you to step 2 is below you will of course have to add in to the csproj manually for each file through "Add existing items"