From 67450eda96c0ad921524f4b0690cb349a2b69372 Mon Sep 17 00:00:00 2001 From: David Glassborow Date: Mon, 17 Jun 2019 12:03:06 +0100 Subject: [PATCH 1/2] Set all macos samples to close the app once the main window is shut --- samples/AllControls/macOS/AppDelegate.fs | 2 ++ samples/Calculator/macOS/AppDelegate.fs | 2 ++ samples/CounterApp/macOS/AppDelegate.fs | 2 ++ samples/StaticView/StaticViewCounterApp/macOS/AppDelegate.fs | 2 ++ samples/TicTacToe/macOS/AppDelegate.fs | 2 ++ 5 files changed, 10 insertions(+) diff --git a/samples/AllControls/macOS/AppDelegate.fs b/samples/AllControls/macOS/AppDelegate.fs index 855489e98..b0be91052 100644 --- a/samples/AllControls/macOS/AppDelegate.fs +++ b/samples/AllControls/macOS/AppDelegate.fs @@ -27,6 +27,8 @@ type AppDelegate() = // Insert code here to tear down your application () + override __.ApplicationShouldTerminateAfterLastWindowClosed(_) = true + module EntryClass = [] let Main(args: string[]) = diff --git a/samples/Calculator/macOS/AppDelegate.fs b/samples/Calculator/macOS/AppDelegate.fs index 66723ad44..f4b352c3f 100644 --- a/samples/Calculator/macOS/AppDelegate.fs +++ b/samples/Calculator/macOS/AppDelegate.fs @@ -27,6 +27,8 @@ type AppDelegate() = // Insert code here to tear down your application () + override __.ApplicationShouldTerminateAfterLastWindowClosed(_) = true + module EntryClass = [] let Main(args: string[]) = diff --git a/samples/CounterApp/macOS/AppDelegate.fs b/samples/CounterApp/macOS/AppDelegate.fs index 4c7212a5c..7b69fe8e1 100644 --- a/samples/CounterApp/macOS/AppDelegate.fs +++ b/samples/CounterApp/macOS/AppDelegate.fs @@ -27,6 +27,8 @@ type AppDelegate() = // Insert code here to tear down your application () + override __.ApplicationShouldTerminateAfterLastWindowClosed(_) = true + module EntryClass = [] let Main(args: string[]) = diff --git a/samples/StaticView/StaticViewCounterApp/macOS/AppDelegate.fs b/samples/StaticView/StaticViewCounterApp/macOS/AppDelegate.fs index 0fdbcee2f..795d9b93a 100644 --- a/samples/StaticView/StaticViewCounterApp/macOS/AppDelegate.fs +++ b/samples/StaticView/StaticViewCounterApp/macOS/AppDelegate.fs @@ -27,6 +27,8 @@ type AppDelegate() = // Insert code here to tear down your application () + override __.ApplicationShouldTerminateAfterLastWindowClosed(_) = true + module EntryClass = [] let Main(args: string[]) = diff --git a/samples/TicTacToe/macOS/AppDelegate.fs b/samples/TicTacToe/macOS/AppDelegate.fs index 5528e7184..c85dff7cc 100644 --- a/samples/TicTacToe/macOS/AppDelegate.fs +++ b/samples/TicTacToe/macOS/AppDelegate.fs @@ -27,6 +27,8 @@ type AppDelegate() = // Insert code here to tear down your application () + override __.ApplicationShouldTerminateAfterLastWindowClosed(_) = true + module EntryClass = [] let Main(args: string[]) = From f034274d1913658f275b2101e3bae87d3589985a Mon Sep 17 00:00:00 2001 From: David Glassborow Date: Mon, 17 Jun 2019 12:04:34 +0100 Subject: [PATCH 2/2] Set macos template to close the app once the main window is shut --- templates/content/blank/NewApp.macOS/AppDelegate.fs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/content/blank/NewApp.macOS/AppDelegate.fs b/templates/content/blank/NewApp.macOS/AppDelegate.fs index f8c295cdd..049825712 100644 --- a/templates/content/blank/NewApp.macOS/AppDelegate.fs +++ b/templates/content/blank/NewApp.macOS/AppDelegate.fs @@ -26,6 +26,8 @@ type AppDelegate() = override __.WillTerminate(notification: NSNotification) = // Insert code here to tear down your application () + + override __.ApplicationShouldTerminateAfterLastWindowClosed(_) = true module EntryClass = []