Beispiel #1
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;
                }
            }
        }
Beispiel #2
0
        private void UpdatePosition(bool useTransitions)
        {
            if (_ya != null)
            {
                IEasingFunction ease = new CircleEase(); // ExponentialEase { Exponent = 1 };

                Duration d = new Duration(TimeSpan.Zero);
                if (useTransitions)
                {
                    double random = Random.NextDouble();
                    double min    = 1.0;
                    double extra  = random * 2.5;
                    d = new Duration(TimeSpan.FromSeconds(min + extra));
                }

                var loc = 0.0;

                switch (_currentState)
                {
                case TileState.Text:
                    loc = 0.0;
                    break;

                case TileState.Partial:
                    loc = NegativeHalfTileSize;
                    break;

                case TileState.Image:
                    loc = NegativeTileSize;
                    break;
                }

                _ya.GoTo(loc, d, ease);
            }
        }
Beispiel #3
0
        private void OnManipulationDelta(object sender, ManipulationDeltaEventArgs e)
        {
            if (_setup)
            {
                _setup = false;
                if (_header != null)
                {
                    _ta.GoTo(-Hardcoded, new Duration(TimeSpan.Zero));
                    _header.Visibility = Visibility.Visible;
                }
            }
            double y = e.CumulativeManipulation.Translation.Y;

            if (y > Hardcoded && e.DeltaManipulation.Translation.Y <= 0)
            {
//                y = hardcoded + e.DeltaManipulation.Translation.Y;
            }
            //double yy = Math.Min(y, hardcoded);
            if (_ta != null)
            {
                _ta.GoTo(Math.Min(y - Hardcoded, 0), SimpleDuration);
            }
        }