private async void AppBarButton_Click(object sender, RoutedEventArgs e) { await CheckInternet(); await checkLocation(); if (isConnected == true && isLocationEnabled == true) { dataToday = new UpdateViewToday(_viewModel); // StoryBoardToday.Begin(); } }
protected async override void OnNavigatedTo(NavigationEventArgs e) { // If _isNewPageInstance is true, the page constuctor has been called, so // state may need to be restored. if (_isNewPageInstance) { if (_viewModel == null) { if (State.Count > 0) { _viewModel = (ViewModelTomorrow)State["ViewModelToday"]; } else { _viewModel = new ViewModelTomorrow(); } } dataToday = new UpdateViewToday(_viewModel); tomorrow_button.IsEnabled = false; await Task.Delay(2000); tomorrow_button.IsEnabled = true; StoryBoardToday.Begin(); DataContext = _viewModel; } //ShowPopup(); // Set _isNewPageInstance to false. If the user navigates back to this page // and it has remained in memory, this value will continue to be false. _isNewPageInstance = false; //Call to Refresh class which refreshes view }