public void Play(double fromProgress, double toProgress, bool looped) { if (_animation != null) { if (_animation.IsAnimationPlaying) { _animation.Stop(); } _animation.LoopAnimation = looped; void Start() { _animation.PlayFromProgress((nfloat)fromProgress, (nfloat)toProgress, isFinished => { if (looped && isFinished) { Start(); } }); } Start(); SetIsPlaying(true); } }
private void AppMovedBackground(object sender, NSNotificationEventArgs args) { _animationView?.Stop(); }
public void Stop() { _isPlaying = false; _animation.Stop(); }