/// <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(); }); }
// 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); }
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)); }
public static void Initialize(FormsApplicationDelegate _AppDelegate) { AppDelegate = _AppDelegate; Popup.Init(); }
/// <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))); }