/// <summary>
        /// Initializes the Background For Mac
        /// </summary>
        /// <param name="appDelegate"></param>
        public static void Init(FormsApplicationDelegate appDelegate)
        {
            MessagingCenter.Subscribe <StartLongRunningTask>(appDelegate, nameof(StartLongRunningTask),
                                                             message => { MatchaBackgroundSharedService.Instance.Start(); });

            MessagingCenter.Subscribe <StopLongRunningTask>(appDelegate, nameof(StopLongRunningTask),
                                                            message => { MatchaBackgroundSharedService.Instance.Stop(); });
        }
Esempio n. 2
0
        // ReSharper restore InconsistentNaming

        public static UIInterfaceOrientationMask GetSupportedInterfaceOrientations(FormsApplicationDelegate appDelegate,
                                                                                   UIInterfaceOrientationMask defaultOrientationMask)
        {
            _appDelegate = _appDelegate ?? appDelegate ?? throw new ArgumentNullException(nameof(appDelegate));
            if (_defaultOrientationMask == null)
            {
                _defaultOrientationMask = _currentOrientationMask = defaultOrientationMask;
            }
            return(_currentOrientationMask);
        }
Esempio n. 3
0
        public IOSHostingPlatform(FormsApplicationDelegate activity)
        {
            _activity = activity;

            UIApplication.Notifications.ObserveDidFinishLaunching((sender, args) => OnCreated(this, null));
            UIApplication.Notifications.ObserveDidBecomeActive((sender, args) => OnStarted(this, null));
            UIApplication.Notifications.ObserveWillResignActive((sender, args) => OnDeactivate(this, null));
            UIApplication.Notifications.ObserveDidEnterBackground((sender, args) => OnPause(this, null));
            UIApplication.Notifications.ObserveWillEnterForeground((sender, args) => OnEnterForeground(this, null));
            UIApplication.Notifications.ObserveDidBecomeActive((sender, args) => OnResume(this, null));
            UIApplication.Notifications.ObserveWillTerminate((sender, args) => OnStopped(this, null));
        }
Esempio n. 4
0
 public static void Initialize(FormsApplicationDelegate _AppDelegate)
 {
     AppDelegate = _AppDelegate;
     Popup.Init();
 }
Esempio n. 5
0
 /// <summary>
 /// Configures the host services with an insatnce of <see cref="IXamarinHostingPlatform"/>
 /// </summary>
 /// <param name="builder">The <see cref="IXamarinHostBuilder"/> to configure.</param>
 /// <param name="app">The instance of <see cref="FormsApplicationDelegate"/> to register.</param>
 /// <returns>The <see cref="IXamarinHostBuilder"/>.</returns>
 public static IXamarinHostBuilder UsePlatform(this IXamarinHostBuilder builder, FormsApplicationDelegate app)
 {
     return(builder.UsePlatform(new IOSHostingPlatform(app)));
 }