private void UpdateAnimationFrame() { if(this.SelectedFrame.Index == SelectedAnimation.FrameCount && !loopAnimation) { animationTimer.Stop(); IsAnimationPlaying = false; } else SelectedFrame = (this.SelectedFrame.Index == SelectedAnimation.FrameCount) ? selectedAnimation.Frames[0] : selectedAnimation.Frames[selectedFrame.Index]; }
public void PlayAnimation() { Int32 framesPerSecond = -1; if (!Int32.TryParse(this.animationFPS, out framesPerSecond)) return; //Reset the animation SelectedFrame = SelectedAnimation.Frames[0]; animationTimer.Interval = 1000 / (Double)framesPerSecond; animationTimer.Start(); IsAnimationPlaying = true; }