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 7861489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:45:34+00:00 2026-06-02T22:45:34+00:00

I have trying a simple repeat animation on xaml page as below: <StackPanel Canvas.Left=1

  • 0

I have trying a simple repeat animation on xaml page as below:

<StackPanel Canvas.Left="1" Canvas.Top="1">
    <StackPanel.Triggers>
        <EventTrigger RoutedEvent="Loaded">
            <BeginStoryboard>
                <Storyboard x:Name="sb_PathGeometry" RepeatBehavior="Forever">
                     <PointAnimationUsingPath Storyboard.TargetName="PathGeometry"  
                          Storyboard.TargetProperty="Center"  
                          Duration="0:0:1">
                          <PointAnimationUsingPath.PathGeometry>
                              <PathGeometry Figures="M 10,0 L 10,-182 L -199,-182" />
                          </PointAnimationUsingPath.PathGeometry>
                     </PointAnimationUsingPath>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </StackPanel.Triggers>
</StackPanel>

Then after that, I plan to get control on idle page with the code below (Find from another site):

using System.Windows.Threading;
using System.Windows.Interop;

namespace DS
{
    public partial class MontagePage : Page
    {
        private EventHandler handler;

        public MontagePage()
        {
            InitializeComponent();

            handler = delegate
            {
                DispatcherTimer timer = new DispatcherTimer();
                timer.Interval = TimeSpan.FromSeconds(4);
                timer.Tick += delegate
                {
                    if (timer != null)
                    {
                        timer.Stop();
                        timer = null;
                        System.Windows.Interop.ComponentDispatcher.ThreadIdle -= handler;
                        ComponentDispatcher_ThreadIdle();
                        System.Windows.Interop.ComponentDispatcher.ThreadIdle += handler;
                    }
                };
                timer.Start();

                //System.Windows.Interop.ComponentDispatcher.ThreadIdle -= handler;
                Dispatcher.CurrentDispatcher.Hooks.OperationPosted += delegate
                {
                    if (timer != null)
                    {
                        timer.Stop();
                        timer = null;
                    }
                };
            };

            ComponentDispatcher.ThreadIdle += handler;
        }

        void ComponentDispatcher_ThreadIdle()
        {
            //Go to IdlePage.xaml
            IdlePage idlepage = new IdlePage();
            this.NavigationService.Navigate(idlepage);
        }
    }
}

The problem that I can summarize is:

  1. Because of that animation running on forever, the idle control is not firing. How to make it work?
  • 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-02T22:45:37+00:00Added an answer on June 2, 2026 at 10:45 pm

    Putting this in a different answer, because the approach is different. Change your timer to system timer to leverage on timer.elapsed, where you can spawn an action on a different thread.

     public MontagePage()
        {
            InitializeComponent();
    
            var timer = new System.Timers.Timer {Interval = 4000, Enabled = true};
            timer.Elapsed += (s, a) => Task.Factory.StartNew(ComponentDispatcher_ThreadIdle);
    
            .....
    

    this will work without you changing your XAML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to have a simple CSS based animation on a button (on
I have an annoying problem, i have trying to implement a simple 10 or
I have been trying to create a simple program with Python which uses OpenCV
I have been trying to call a mapreduce job from a simple java program
I have been trying to get more in to TDD. Currently keeping it simple
This is a simple htaccess question for experts but I have been trying to
I have been trying to create an XML using the simplexml library (v2.6.2) http://simple.sourceforge.net/home.php
I'm trying to have a simple html table, that highlights a row as a
I am trying to have a simple java server respond to an XmlHttpRequest, but
Trying to make simple minesweeper game in python, but have one problem. I have

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.