MainWindow ctor overload that takes an AppFunc.