Ejemplo n.º 1
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected 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["ViewModelTomorrow"];
                    }
                    else
                    {
                        _viewModel = new ViewModelTomorrow();
                    }
                }
                //ShowLoadingIndicator();

                StoryBoardTomorrow.Begin();
                dataTomorrow = new UpdateViewTomorrow(_viewModel);

                // HideLoadingIndicator();

                DataContext = _viewModel;
            }


            // 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;
        }
Ejemplo n.º 2
0
        private async void AppBarButton_Click(object sender, RoutedEventArgs e)
        {
            await checkLocation();
            await CheckInternet();

            if (isConnected == true && isLocationEnabled == true)
            {
                dataTomorrow = new UpdateViewTomorrow(_viewModel);
                //StoryBoardTomorrow.Begin();
            }
        }