示例#1
0
 protected override async void OnNavigatedTo(NavigationEventArgs e)
 {
     stateManager.OnNavigatedTo(e);
     if (e.NavigationMode == NavigationMode.Back)
     {
         FavoritesPart.SetContent();
     }
 }
示例#2
0
        //private AdControl AdControl;

        //public void SetPlanningSource(StopGroup stop)
        //{
        //}
        //public void SetPlanningDestination(StopGroup stop)
        //{
        //}

        private async void updateContent()
        {
            FavoritesPart.UpdateContent();
            if (SettingsModel.AutomaticNearSearch)
            {
                var nearestStop = await StopTransfers.GetNearestStop(await CurrentLocation.Get());

                if (nearestStop != null)
                {
                    FavoritesPart.NearStop = nearestStop.Stop.Group;
                    PlanningPart.SetNearStop(nearestStop.Stop.Group, nearestStop.EstimatedDuration);
                }
            }
        }
示例#3
0
        public async void InitializePageState(object parameter)
        {
            if (!App.GetAppInfo().IsEnabled())
            {
                await new MessageDialog("Your trial period has expired. You cannot use the app until you buy the full version.").ShowAsync();
                App.Current.Exit();
            }

            InitializerProcess.SendStatisctics();
            Logging.Upload();

            if (!App.TB.DatabaseExists || AppFields.ForceUpdate)
            {
                var downloadResult = await DownloadDBDialog.Show();
                await DownloadDone(downloadResult, true);
            }
            if (InitializerProcess.FirstRun)
            {
                await ShowLocationConsentBox();
            }
            FavoritesPart.SetContent();
            stateManager.ScheduleTaskEveryMinute(updateContent);

            //if (App.SourceTileId != null)
            //{
            //    NavigateToTile(App.SourceTileId.Value);
            //}

            var checkUpdateResult = await UpdateMonitor.CheckUpdate();

            if (checkUpdateResult == UpdateMonitor.Result.Found)
            {
                IndicateUpdateAvailable();
            }

            //await Task.Delay(1000);
            //Frame.Navigate(typeof(TestPage));
        }