Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Canvas ClipToBounds="True" Name="canMain" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
- <StackPanel Name="tbmarquee" HorizontalAlignment="Stretch" ></StackPanel>
- </Canvas>
- private void BottomToTopMarquee()
- {
- tbmarquee.Orientation = Orientation.Vertical;
- DoubleAnimation doubleAnimation = new DoubleAnimation();
- doubleAnimation.From = -tbmarquee.ActualHeight;
- doubleAnimation.To = canMain.ActualHeight;
- doubleAnimation.RepeatBehavior = RepeatBehavior.Forever;
- doubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(_marqueeTimeInSeconds));
- tbmarquee.BeginAnimation(Canvas.BottomProperty, doubleAnimation);
- }
- Thread thread = new Thread(new ThreadStart(
- delegate()
- {
- DispatcherOperation dispatcherOp =
- this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(
- delegate()
- {
- DoubleAnimation doubleAnimation = new DoubleAnimation();
- doubleAnimation.From = -tbmarquee.ActualHeight;
- doubleAnimation.To = canMain.ActualHeight;
- doubleAnimation.RepeatBehavior = RepeatBehavior.Forever;
- doubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(_marqueeTimeInSeconds));
- tbmarquee.BeginAnimation(Canvas.BottomProperty, doubleAnimation);
- }));
- dispatcherOp.Completed += new EventHandler(DispatcherOpCompleted);
- }));
- thread.Start();
- MediaTimeline.DesiredFrameRateProperty.OverrideMetadata(typeof(System.Windows.Media.Animation.Timeline), new FrameworkPropertyMetadata(10));
Add Comment
Please, Sign In to add comment