예제 #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;
        }
예제 #2
0
        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
        }