Ejemplo n.º 1
0
        private void StartAnimation()
        {
            if (!Animation.IsEnabled)
            {
                return;
            }

            _ = Task.Run(async() =>
            {
                if (_semaphoreForAnimation.CurrentCount == 0)
                {
                    return;
                }

                _semaphoreForAnimation.Wait();

                _ = _homeActiveIconImage.FadeTo(0.25, length: 0);
                await _homeActiveIconImage.RelScaleTo(ANIMATION_SCALE_VALUE,
                                                      length: ANIMATION_SCALEIN_DURATION_IN_MILLIS,
                                                      easing: Easing.Linear
                                                      );
                await _homeActiveIconImage.FadeTo(0.0);
                await _homeActiveIconImage.RelScaleTo(-ANIMATION_SCALE_VALUE,
                                                      length: ANIMATION_SCALEOUT_DURATION_IN_MILLIS,
                                                      easing: Easing.Linear
                                                      );
                await Task.Delay(ANIMATION_INTERVAL_IN_MILLIS);

                _semaphoreForAnimation.Release();
            });
        }