Guest User

Untitled

a guest
Jan 4th, 2013
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <Canvas ClipToBounds="True" Name="canMain" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
  2. <StackPanel Name="tbmarquee" HorizontalAlignment="Stretch" ></StackPanel>
  3. </Canvas>
  4.  
  5. private void BottomToTopMarquee()
  6. {
  7. tbmarquee.Orientation = Orientation.Vertical;
  8. DoubleAnimation doubleAnimation = new DoubleAnimation();
  9. doubleAnimation.From = -tbmarquee.ActualHeight;
  10. doubleAnimation.To = canMain.ActualHeight;
  11. doubleAnimation.RepeatBehavior = RepeatBehavior.Forever;
  12. doubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(_marqueeTimeInSeconds));
  13. tbmarquee.BeginAnimation(Canvas.BottomProperty, doubleAnimation);
  14. }
  15.  
  16. Thread thread = new Thread(new ThreadStart(
  17. delegate()
  18. {
  19. DispatcherOperation dispatcherOp =
  20. this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(
  21. delegate()
  22. {
  23.  
  24. DoubleAnimation doubleAnimation = new DoubleAnimation();
  25. doubleAnimation.From = -tbmarquee.ActualHeight;
  26. doubleAnimation.To = canMain.ActualHeight;
  27. doubleAnimation.RepeatBehavior = RepeatBehavior.Forever;
  28. doubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(_marqueeTimeInSeconds));
  29. tbmarquee.BeginAnimation(Canvas.BottomProperty, doubleAnimation);
  30. }));
  31. dispatcherOp.Completed += new EventHandler(DispatcherOpCompleted);
  32. }));
  33. thread.Start();
  34.  
  35. MediaTimeline.DesiredFrameRateProperty.OverrideMetadata(typeof(System.Windows.Media.Animation.Timeline), new FrameworkPropertyMetadata(10));
Add Comment
Please, Sign In to add comment