Пример #1
0
 private void OnPollValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
 {
     if (PollSliderGlow != null && pollingSlider != null)
     {
         //PollSliderGlow.Duration = TimeSpan.FromMilliseconds(pollingSlider.Value);
         if (reversePollValue(pollingSlider.Value) == pollingSlider.Maximum)
         {
             PollSliderGlow.Seek(pollingSlider, TimeSpan.FromMilliseconds(0), System.Windows.Media.Animation.TimeSeekOrigin.BeginTime);
             PollSliderGlow.Pause(pollingSlider);
         }
         else
         {
             PollSliderGlow.Resume(pollingSlider);
             PollSliderGlow.SetSpeedRatio(pollingSlider, 1.0 / reversePollValue(pollingSlider.Value));
         }
     }
 }
Пример #2
0
 private void OnPollValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
 {
     if (PollSliderGlow != null && pollingSlider != null)
     {
         delayMs = (int)(reversePollValue(pollingSlider.Value) * 1000.0);
         //PollSliderGlow.Duration = TimeSpan.FromMilliseconds(pollingSlider.Value);
         if (pollingSlider.Maximum - reversePollValue(pollingSlider.Value) <= .02)
         {
             shouldUpdate = false;
             PollSliderGlow.Seek(pollingSlider, TimeSpan.FromMilliseconds(0), System.Windows.Media.Animation.TimeSeekOrigin.BeginTime);
             PollSliderGlow.Pause(pollingSlider);
         }
         else
         {
             shouldUpdate = true;
             PollSliderGlow.Resume(pollingSlider);
             PollSliderGlow.SetSpeedRatio(pollingSlider, 1.0 / reversePollValue(pollingSlider.Value));
         }
     }
 }