Exemplo n.º 1
0
        private void StartTransition(VisualView view, bool activate)
        {
            if (_animation)
            {
                _animation.Stop();
                _animation.Finished += OnTransitionFinished;
            }

            if (activate)
            {
                view.AnimateVisualAdd(_icon, "Position", new Position2D(80, 80), 0, 2000, AlphaFunction.BuiltinFunctions.Linear, new Position2D(5, 5));
                view.AnimateVisualAdd(_icon2, "Opacity", 0.0f, 0, 2000, AlphaFunction.BuiltinFunctions.Linear);
                view.AnimateVisualAdd(_icon3, "MixColor", Color.Green, 0, 2000, AlphaFunction.BuiltinFunctions.Linear);
                view.AnimateVisualAdd(_icon4, "Size", new Size2D(150, 150), 0, 2000, AlphaFunction.BuiltinFunctions.Linear);
                _animation = view.AnimateVisualAddFinish();
            }
            else
            {
                view.AnimateVisualAdd(_icon, "Position", new Position2D(5, 5), 0, 2000, AlphaFunction.BuiltinFunctions.Linear, new Position2D(80, 80));
                view.AnimateVisualAdd(_icon2, "Opacity", 1.0f, 0, 2000);
                view.AnimateVisualAdd(_icon3, "MixColor", Color.Red, 0, 2000);
                view.AnimateVisualAdd(_icon4, "Size", new Size2D(50, 50), 0, 2000, AlphaFunction.BuiltinFunctions.Linear);
                _animation = view.AnimateVisualAddFinish();
            }

            if (_animation)
            {
                _animation.Finished  += OnTransitionFinished;
                _animation.EndAction  = Animation.EndActions.StopFinal;
                _transitionInProgress = true;
                _animation.Play();
            }
        }
Exemplo n.º 2
0
        private void StartTransition(bool activate)
        {
            if (animation1)
            {
                animation1.Stop();
                animation1.Finished += OnTransitionFinished1;
            }

            if (activate)
            {
                contentView.AnimateVisualAdd(icon, "Size", new Size2D(150, 150), 0, 1000, AlphaFunction.BuiltinFunctions.Linear);
                contentView.AnimateVisualAdd(icon, "Position", new Position2D(40, 40), 0, 1000);
                animation1 = contentView.AnimateVisualAddFinish();
            }
            else
            {
                contentView.AnimateVisualAdd(icon, "Size", new Position2D(50, 50), 0, 1000, AlphaFunction.BuiltinFunctions.Linear);
                contentView.AnimateVisualAdd(icon, "Position", new Position2D(5, 5), 0, 1000);
                animation1 = contentView.AnimateVisualAddFinish();
            }

            if (animation1)
            {
                animation1.Finished += OnTransitionFinished1;
                transitionInProgress = true;
                animation1.Play();
            }
        }