How can i kill the application in xamarin.mac I cant find this.dispose
or Application.Exit
in xamarinMac So How can I kill the application in Xamarin Mac
Asked
Active
Viewed 2,243 times
3 Answers
11
NSApplication.SharedApplication.Terminate(this)
or from static methods
NSApplication.SharedApplication.Terminate(NSApplication.SharedApplication);

ulmer-morozov
- 1,306
- 14
- 13
1
You should use NSApplication.Terminate
.
http://macapi.xamarin.com/?link=M%3aMonoMac.AppKit.NSApplication.Terminate
according to
0
I was able to just use Quit in the application class itself. So as part of the application, I created a page and when that page closed, I called quit. Here is my example:
public App()
{
InitializeComponent();
if (Device.RuntimePlatform == Device.iOS)
MainPage = new MainPage();
else
MainPage = new NavigationPage(new MainPage());
MainPage.Disappearing += MainPage_Disappearing;
}
void MainPage_Disappearing(object sender, EventArgs e)
{
this.Quit();
}

Rob W
- 1
- 2