示例#1
0
 public void animate(MainWindow con, int gdzie, double czas)
 {
     if (!con.CheckAccess())
     {
         con.Dispatcher.Invoke(DispatcherPriority.Send,
         (Action)delegate
         {
             Storyboard storyboard = (con.Resources["CarouselStoryboard"] as Storyboard);
             DoubleAnimation animation = storyboard.Children.First() as DoubleAnimation;
             animation.Duration = new Duration(TimeSpan.FromSeconds(czas));
             animation.To = gdzie;
             storyboard.Begin();
         });
     }
     else
     {
         Storyboard storyboard = (con.Resources["CarouselStoryboard"] as Storyboard);
         DoubleAnimation animation = storyboard.Children.First() as DoubleAnimation;
         animation.Duration = new Duration(TimeSpan.FromSeconds(czas));
         animation.To = gdzie;
         storyboard.Begin();
     }
 }
 public ButtonController(MainWindow c, Thread th)
 {
     con = c;
     thread = th;
 }