public MainPage()
        {
            this.InitializeComponent();
            this.NavigationCacheMode = NavigationCacheMode.Required;

            mainVm = new MainViewModel();
            searchVm = new SearchViewModel();

            NearbyPivot.DataContext = mainVm;
            FavoritesPivot.DataContext = mainVm;
            SearchPivot.DataContext = searchVm;
        }
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            if (alreadyLoaded) return;

            SettingsHelper.LoadNearbySetting();
            SettingsHelper.LoadLaunchPivotSetting();
            MainPivot.SelectedIndex = SettingsHelper.LaunchPivotIndex;

            mainVm = new MainViewModel();
            searchVm = new SearchViewModel();

            NearbyPivot.DataContext = mainVm;
            FavoritesPivot.DataContext = mainVm;
            SearchPivot.DataContext = searchVm;

            SettingsHelper.LoadSettings();
            await DatabaseHelper.CheckDatabasesAsync();
            await searchVm.LoadRoutesAsync();
            RouteBox.IsEnabled = true;
            await mainVm.LoadAsync();

            alreadyLoaded = true;
        }