views:

41

answers:

1

I have some pretty simple code that attempts to slide a custom progress bar over. Here is the XAML:

<!-- Progress display -->
<uControl:ProgressDisplayPie
   x:Name="soakProgressDisp"
   Canvas.Left="357" Canvas.Top="29"
   ProgressValue="0" Height="198" />

In response to a button click, the progress bar slides over:

private void sauceApplied_Click(object sender, RoutedEventArgs e)
{                         
    // Beep beep
    soundPlayer.SoundLocation = "Resources/Audio/1-first.wav";
    soundPlayer.Play();

    // Move the progress display
    DoubleAnimation moveAnimation = new DoubleAnimation();
    moveAnimation.To = 460;
    moveAnimation.Duration = TimeSpan.FromMilliseconds(1000);
    moveAnimation.AccelerationRatio = 1.0;
    soakProgressDisp.BeginAnimation(Canvas.LeftProperty, moveAnimation);                
}

This works every time on my PC. However, when run on a small panel PC, the animation sometimes doesn't happen. The progress bar simply stays put. I checked to see if any exceptions are being thrown, but everything executes cleanly.

The panel PC has the latest .NET and again, it animates sometimes. Any ideas what would prevent the animation from occurring every time?

UPDATE It turns out that the animation will always eventually run. I usually just quit the app if the animation didn't run, but I'm now noticing that the animation will eventually start if I leave it alone. So there's really two modes:

  1. The animation commences and runs immediately as intended
  2. The start of the animation is delayed by some amount of time. I've seen it delayed a few seconds up to about 1 minute!
A: 

Try removing any transparency or Effects and see the if the problem goes away. I have experienced the same problem and it was the buggy AllowTransparency...

Gustavo Cavalcanti
I don't seem to have any effects going on. I also reproduced this with a standard WPF progress bar to make sure it isn't my custom control that is causing the problem.
Tim