Question

Je peux utiliser - (BOOL)applicationShouldTerminateAfterLastWindowClosed: Méthode pour quitter l'application CacaoLorsque la fenêtre se ferme en utilisant la méthode du délégué de l'application.

Comment puis-je faire la même chose avec Monomac?En général, comment mapper la méthode Objective-C à la fonction C # de Monomac?

Était-ce utile?

La solution

I found this code, I see that I can use the same function in the delegate.

namespace AnimatingViews
{
    public partial class AppDelegate : NSApplicationDelegate
    {
        AnimatingViewsWindowController animatingViewsWindowController;

        public AppDelegate ()
        {
        }

        public override void FinishedLaunching (NSObject notification)
        {
            animatingViewsWindowController = new AnimatingViewsWindowController ();
            animatingViewsWindowController.Window.MakeKeyAndOrderFront (this);
        }

        public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
        {
            return true;
        }
    }
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top