Exemple #1
0
        private void RestoreLoadingGrid()
        {
            Debug.WriteLine("RestoreLoadingGrid");
            if (!_contentPresenterUnloaded)
            {
                _loadingProcessDone = true;

                if (_loadingGrid != null)
                {
                    _loadingGrid.Visibility = System.Windows.Visibility.Visible;
                    _loadingGrid.Opacity    = 1;
                }

                _contentPresenter.IsHitTestVisible = false;

                // Fade out the content
                if (_contentGrid != null)
                {
                    MyOpacityAnimator cg = null;
                    MyOpacityAnimator.EnsureAnimator(_contentGrid, ref cg);
                    if (cg != null)
                    {
                        cg.GoTo(0, TransitionDuration);
                    }
                    else
                    {
                        _contentGrid.Opacity = 0;
                    }
                }
            }
        }
Exemple #2
0
        private void ShowLoadingExperience()
        {
            _hasShownLoadingScreen = true;
            if (_progressBar != null)
            {
                /*var binding = new Binding("IsLoading");
                 * binding.Source = GlobalLoading.Instance;
                 * binding.Converter = new InvertConverter();
                 * _progressBar.SetBinding(ProgressBar.IsIndeterminateProperty, binding);*/
                _progressBar.IsIndeterminate = true;
            }
            if (_loadingGrid != null)
            {
                // Not sure what this nice phone-similar effect costs yet...
                TransformYAnimator ta = null;
                TransformYAnimator.EnsureAnimator(_loadingGrid, ref ta);
                if (ta != null)
                {
                    ta.GoTo(50, new Duration(TimeSpan.Zero));
                    ta.GoTo(0, TransitionDuration, new QuarticEase());
                }

                MyOpacityAnimator oa = null;
                MyOpacityAnimator.EnsureAnimator(_loadingGrid, ref oa);
                if (oa != null)
                {
                    oa.GoTo(1, TransitionDuration);
                }
                else
                {
                    _loadingGrid.Opacity = 1;
                }
            }
        }
Exemple #3
0
        private void FinallyShowContent()
        {
            Debug.WriteLine("FinallyShowContent");
            if (!_contentPresenterUnloaded)
            {
                _loadingProcessDone = true;

                // No longer need this reference. Do still want resume though!
                //_advancedWaitingElement = null;
                _dataStatusElement = null;

                if (_loadingGrid != null)
                {
                    if (_progressBar != null)
                    {
                        _progressBar.IsIndeterminate = false;
                        _progressBar.Visibility      = Visibility.Collapsed;
                    }

                    AfterFadeOut();
                }

                _contentPresenter.IsHitTestVisible = true;

                // Fade in the new content
                if (_contentGrid != null)
                {
                    MyOpacityAnimator cg = null;
                    MyOpacityAnimator.EnsureAnimator(_contentGrid, ref cg);
                    if (cg != null)
                    {
                        cg.GoTo(1, TransitionDuration);
                    }
                    else
                    {
                        _contentGrid.Opacity = 1;
                    }
                }
            }
        }