Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8909291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:23:33+00:00 2026-06-15T03:23:33+00:00

I am attempting to create a multi-part timer that does the following… Slide canvas

  • 0

I am attempting to create a multi-part timer that does the following…

  • Slide canvas object down.
  • Change object off-screen.
  • Slide canvas object up (to original position).

This will be triggered every 5 seconds by a Dispatcher timer but i am unsure as to how to get the object to slide up/down as my attempts at using a loop for this have caused the application to lock up.

Any ideas on how this could be done would be of a huge help to me, thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T03:23:35+00:00Added an answer on June 15, 2026 at 3:23 am

    WPF has a nice animation class to handle stuff like this.

    Here is a quick example (code behind only) I use this method in mutiple applications to quickly create an animation.

        /// <summary>
        /// Creates a double animation.
        /// </summary>
        /// <param name="from">From position</param>
        /// <param name="to">To position</param>
        /// <param name="duration">The duration.</param>
        /// <param name="delay">The delay.</param>
        /// <param name="autoreverse">if set to <c>true</c> [autoreverse].</param>
        /// <param name="repeat">The times to repeat.</param>
        /// <returns>new double animation</returns>
        public static DoubleAnimationUsingKeyFrames GetDoubleAnimation(double from, double to, int duration, int delay, bool autoreverse, int repeat)
            {
                var doubleanimation = new DoubleAnimationUsingKeyFrames();
                doubleanimation.AutoReverse = autoreverse;
                doubleanimation.IsAdditive = false;
                Storyboard.SetDesiredFrameRate(doubleanimation, 30);
                doubleanimation.IsCumulative = false;
                doubleanimation.BeginTime = new TimeSpan(0, 0, 0, 0, delay);
                doubleanimation.Duration = new Duration(TimeSpan.FromMilliseconds(duration));
                doubleanimation.RepeatBehavior = repeat == -1 ? RepeatBehavior.Forever : new RepeatBehavior(repeat);
                EasingDoubleKeyFrame start = new EasingDoubleKeyFrame(from, KeyTime.FromPercent(0));
                EasingDoubleKeyFrame end = new EasingDoubleKeyFrame(to, KeyTime.FromPercent(1.0));
                doubleanimation.KeyFrames.Add(start);
                doubleanimation.KeyFrames.Add(end);
                return doubleanimation;
            }
    

    Usage:

       myCanvas.BeginAnimation(Canvas.TopProperty, GetDoubleAnimation(100, 400, 2000,0,false,1));
    

    This will animate the canvas vertically from 100 to 400 over 2 seconds.

    Xaml:

    <Window x:Class="WpfApplication5.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="350" Width="525">
        <Canvas>
            <Canvas Name="myCanvas" Margin="77,102,191,102" Background="Black" Height="73" Width="113" />
        </Canvas>
    </Window>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to create a table for monitoring purposes using the following script: $w3wppriv
I am attempting to create a report, utilizing a matrix, that only displays columns
I'm attempting to create a single Controller class to handle all foreseeable surveys that
I am attempting a basic recursion to create multi-dimensional arrays based on the values
I'm attempting to create an array of strings that represent the directories stored in
I'm attempting to create a report for an accommodation service with the following information:
I'm attempting to create a Parcelable class in Android so that I can pass
I am attempting to create the following class name signature: public class MyClass<T> where
I am attempting to create an inbound Mule endpoint that will receive Syslog messages
I'm having some problems attempting to create a multi-threaded Server. Everything works fine until

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.