Hello,
if Main.cs is a code behind of a Window or Usercontrol, it's executed into UI Thread and you don't need to add a dispatcher.
In general, all the code is executed in UI Thread excepted if you launch some part of your code into another thread manually.
Regards
Cedric