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 same.
CodePudding user response:
Override the applicationShouldTerminateAfterLastWindowClosed method in appdelegate like:
public override bool ApplicationShouldTerminateAfterLastWindowClosed(NSApplication sender)
{
return false;
}