コード例 #1
0
        private void OnApplicationLifetimeChanged(object sender, MvxLifetimeEventArgs args)
        {
            if (args.LifetimeEvent == MvxLifetimeEvent.ActivatedFromDisk || args.LifetimeEvent == MvxLifetimeEvent.ActivatedFromMemory)
            {
                _isStarted = StartService();
            }

            if (args.LifetimeEvent == MvxLifetimeEvent.Closing || args.LifetimeEvent == MvxLifetimeEvent.Deactivated)
            {
                _isStarted = !StopService();
            }
        }
コード例 #2
0
        void TaxiHailApp_LifetimeChanged(object sender, MvxLifetimeEventArgs e)
        {
            switch (e.LifetimeEvent)
            {
            case MvxLifetimeEvent.Closing:
            case MvxLifetimeEvent.Deactivated:
                ClearAppCache();
                break;

            case MvxLifetimeEvent.Launching:
            case MvxLifetimeEvent.ActivatedFromMemory:
            case MvxLifetimeEvent.ActivatedFromDisk:
                RefreshAppData();
                Mvx.Resolve <IApplicationInfoService>().CheckVersionAsync();
#if !MONOTOUCH
                TryFacebookInitAndPublish();
#endif
                break;
            }
        }
コード例 #3
0
        private void OnApplicationLifetimeChanged(object sender, MvxLifetimeEventArgs args)
        {
            if (args.LifetimeEvent == MvxLifetimeEvent.ActivatedFromDisk || args.LifetimeEvent == MvxLifetimeEvent.ActivatedFromMemory)
            {
                // since this is called before OnViewStarted and AutomaticLocateMe needs it, do it here, otherwise AutomaticLocateMe will be very slow
                _locationService.Start();

                var isInBookingMode = CurrentViewState == HomeViewModelState.ManualRidelinq ||
                                      CurrentViewState == HomeViewModelState.BookingStatus;

                if (!isInBookingMode)
                {
                    Task.Run(() => VerifyActiveOrder()).FireAndForget();
                }

                AutomaticLocateMeAtPickup.ExecuteIfPossible();
                CheckUnratedRide();
                CheckTermsAsync();
                CheckCreditCardExpiration().FireAndForget();
                AddressPicker.RefreshFilteredAddress();

                _metricsService.LogApplicationStartUp();
            }
        }