public Point AnimatedPoint() { Point point = new Point(); if (_currentStep == null && _steps.Count > 0) { _currentStep = _steps.Dequeue(); } if (_tick == _currentStep.DurationInTicks && _steps.Count > 0) { _currentStep = _steps.Dequeue(); _tick = 0; } else if (_tick == _currentStep.DurationInTicks && _steps.Count == 0) { IsDone = true; } if (_tick < _currentStep.DurationInTicks) { if (!_currentStep.IsPause) { point = PointAnimation(); } _tick++; } return(point); }
public void Animate() { if (_currentStep == null && _steps.Count > 0) { _currentStep = _steps.Dequeue(); } if (_tick == _currentStep.DurationInTicks && _steps.Count > 0) { _currentStep = _steps.Dequeue(); _tick = 0; } else if (_tick == _currentStep.DurationInTicks && _steps.Count == 0) { IsDone = true; } if (_tick < _currentStep.DurationInTicks) { if (!_currentStep.IsPause) { switch (_type) { case AnimationType.Position: PositionAnimation(); break; case AnimationType.Size: SizeAnimation(); break; } } _tick++; } }