Beispiel #1
0
        public static void MapTerminate(ApplicationHandler handler, IApplication application, object?args)
        {
            var currentActivity = ApplicationModel.Platform.CurrentActivity;

            if (currentActivity != null)
            {
                currentActivity.FinishAndRemoveTask();

                Environment.Exit(0);
            }
        }
Beispiel #2
0
        public static void MapCloseWindow(ApplicationHandler handler, IApplication application, object?args)
        {
            if (args is IWindow window)
            {
                // See if the window's handler has an associated UIWindowScene and UISceneSession
                var sceneSession = (window.Handler?.NativeView as UIWindow)?.WindowScene?.Session;

                if (sceneSession != null)
                {
                    // Request that the scene be destroyed
                    // TODO: Error handler?
                    UIApplication.SharedApplication.RequestSceneSessionDestruction(sceneSession, null, null);
                }
            }
        }
 public static void MapTerminate(ApplicationHandler handler, IApplication application, object?args)
 {
     handler.Logger?.LogWarning("Android does not support programmatically terminating the app.");
 }
 public static void MapOpenWindow(ApplicationHandler handler, IApplication application, object?args)
 {
     handler.NativeView?.RequestNewWindow(application, args as OpenWindowRequest);
 }
Beispiel #5
0
 public static void MapTerminate(ApplicationHandler handler, IApplication application, object?args)
 {
     handler.NativeView.Exit();
 }
Beispiel #6
0
 public static void MapTerminate(ApplicationHandler handler, IApplication application, object?args)
 {
 }
Beispiel #7
0
 public static void MapCloseWindow(ApplicationHandler handler, IApplication application, object?args)
 {
 }
 public static void MapOpenWindow(ApplicationHandler handler, IApplication application, object?args)
 {
     handler.PlatformView?.CreatePlatformWindow(application, args as OpenWindowRequest);
 }