Пример #1
0
        private async void animate()
        {
            await Task.Delay(2000);

            if (!_isShowing)
            {
                return;
            }

            var task1 = _viewport1.TweenProjectY(0.37f, 1f, Ease.QuadIn).Task;
            var task2 = _viewport2.TweenProjectY(0.07f, 1f, Ease.QuadIn).Task;
            await Task.WhenAll(task1, task2);

            await Task.Delay(1000);

            if (!_isShowing)
            {
                return;
            }

            task1 = _viewport1.TweenProjectWidth(0.1f, 1f, Ease.BounceIn).Task;
            task2 = _viewport2.TweenProjectWidth(0.1f, 1f, Ease.BounceIn).Task;
            await Task.WhenAll(task1, task2);

            await Task.Delay(1000);

            if (!_isShowing)
            {
                return;
            }

            task1 = _viewport1.TweenProjectY(0.07f, 1f, Ease.SineInOut).Task;
            task2 = _viewport2.TweenProjectY(0.37f, 1f, Ease.SineInOut).Task;
            var task3 = _viewport1.TweenProjectWidth(0.25f, 1.5f, Ease.SineInOut).Task;
            var task4 = _viewport2.TweenProjectWidth(0.25f, 1.5f, Ease.SineInOut).Task;
            await Task.WhenAll(task1, task2, task3, task4);

            await Task.Delay(1000);

            if (!_isShowing)
            {
                return;
            }

            task1 = _viewport1.TweenScaleX(2f, 1f, Ease.CircIn).Task;
            task2 = _viewport1.TweenScaleY(2f, 1f, Ease.CircIn).Task;
            task3 = _viewport2.TweenAngle(45f, 1f, Ease.ExpoOut).Task;
            await Task.WhenAll(task1, task2, task3);

            await Task.Delay(1000);

            if (!_isShowing)
            {
                return;
            }

            task1 = _viewport1.TweenScaleX(1f, 1f, Ease.CircOut).Task;
            task2 = _viewport1.TweenScaleY(1f, 1f, Ease.CircOut).Task;
            task3 = _viewport2.TweenAngle(0f, 1f, Ease.ExpoIn).Task;
            await Task.WhenAll(task1, task2, task3);

            await Task.Delay(1000);

            var restrictionList = _viewport2.DisplayListSettings.RestrictionList;

            if (restrictionList.RestrictionList.Count == 0)
            {
                restrictionList.RestrictionType = RestrictionListType.WhiteList;
                restrictionList.RestrictionList.Add("Beman");
            }
            else
            {
                restrictionList.RestrictionList.Clear();
            }

            animate();
        }