Home > Back-end >  Xamarin Mac minimize to tray on close button
Xamarin Mac minimize to tray on close button

Time:12-08

I want change behavior of standard close button of window. When user clicked on it then minimize to tray, not close window. How can I do this?

P.S Here is a small video example of this behavior on Slack application. I want do sameenter image description here.

CodePudding user response:

Override the applicationShouldTerminateAfterLastWindowClosed method in appdelegate like:

public override bool ApplicationShouldTerminateAfterLastWindowClosed(NSApplication sender)
{
return false;
}
  • Related