void AnimateCooldown() { if (_context == null) { return; } var an = new DoubleAnimation(0, 359.9, TimeSpan.FromMilliseconds(_context.DurationLeft)); var fps = _context.DurationLeft > 20000 ? 1 : 10; Timeline.SetDesiredFrameRate(an, fps); Arc.BeginAnimation(Arc.EndAngleProperty, an); }
private void AnimateCooldown(double angle = 1) { var an = new DoubleAnimation(angle * 359.9, 0, TimeSpan.FromMilliseconds(_context.Cooldown)); var fps = _context.Cooldown > 80000 ? 1 : 30; Timeline.SetDesiredFrameRate(an, fps); if (_context.Pre) { PreArc.BeginAnimation(Arc.EndAngleProperty, an); } else { PreArc.BeginAnimation(Arc.EndAngleProperty, null); PreArc.EndAngle = 0.01; Arc.BeginAnimation(Arc.EndAngleProperty, an); } _numberTimer.IsEnabled = true; }