many thanks in advance.
I came across a bizarre behaviour. I have the method below, that is called correctly, no problems found. AnimationRunning is a boolean that evaluates correctly to true, but the actual speed of the animation remains the same, even when the value stored in the SpeedRatio is changed (as made evident by the statusbar label), the actual animation speed remains the same.
private void TextBoxTyping(object sender, KeyEventArgs e)
{
if (AnimationRunning == true) { StoryBoard.SpeedRatio += 5; };
statusbar.Content = "Speed: " + StoryBoard.SpeedRatio.ToString();
}
To check whether the AnimationRunning evaluates to true, I popped in a MessageBox.Show("Animation is running"); inside the if closure. And the message does pop out.
However, if I change the code to the following:
private void TextBoxTyping(object sender, KeyEventArgs e)
{
StoryBoard.SpeedRatio += 5;
statusbar.Content = "Speed: " + StoryBoard.SpeedRatio.ToString();
}
The speed of the animation does change. I can't get my head around on how with AnimationRunning being true, I can't get the SpeedRatio to work inside the if statement...
Could help shine some light in this poor mind of mine? Thanks...
Aucun commentaire:
Enregistrer un commentaire