Create new MainWindow object in template