My approach to this is to use existing tools for GUI test automation (since I want to automate on the user level and not on the technical detail level of the implementation).
A very useful one is
Ranorex[
^].
It's a C# API that provides technology independent access to control GUI elements. Usage: Record, export as C#, compile, run. It's affordable for professional users.