Frage

Ich kann - (BOOL)applicationShouldTerminateAfterLastWindowClosed: Methode zum Beenden der Kakao-AppWenn das Fenster verwendet, indem Sie die Methode im Delegierten der Anwendung verwenden.

Wie kann ich mit Monomac dasselbe tun?Wie kann ich im Allgemeinen objektive-c-Methode der C # -Funktion von Monomac zuordnen?

War es hilfreich?

Lösung

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;
        }
    }
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top