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

  • Home
  • SEARCH
  • 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 8858657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:52:48+00:00 2026-06-14T14:52:48+00:00

I am trying to build a clock application in Silverlight. My application has multiple

  • 0

I am trying to build a clock application in Silverlight.
My application has multiple pages, one for analog, one for digital and one for a timer.

If I want to have a separate class that handles the time-keeping as follows:

private void startTimer()
    {
        DispatcherTimer myDispatcherTimer = new DispatcherTimer();
        myDispatcherTimer.Interval = new TimeSpan(0,0,1);
        myDispatcherTimer.Tick += new EventHandler(eachClick);
        myDispatcherTimer.Start();
    }

How can I get the current page that is displayed so that the method can use that page’s event handler?

What is the best way to go about this?

  • 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-14T14:52:48+00:00Added an answer on June 14, 2026 at 2:52 pm

    I dont really understand what exactly you’re trying to do. “How can I get the current page so that the method can use that page event handler?”

    If you have three pages, and you’re trying to synchronize the time between all three of them, why dont you create a static Timer class.

    I dont know, maybe something like this:

    public static class StaticTimer
    {
        public delegate void Time(DateTime time);
        public static event Time Tick = delegate { };
        static StaticTimer()
        {
            DispatcherTimer myDispatcherTimer = new DispatcherTimer();
            myDispatcherTimer.Interval = new TimeSpan(0,0,1);
            myDispatcherTimer.Tick += (s,e) => Tick(DateTime.Now);
            myDispatcherTimer.Start();
        }
    }
    

    Then, from each page, just subscribe to the Tick event when you create it.

    void AnalogPage_OnLoaded( ... )
    {
        StaticTimer.Tick += someEventHandler;
    }
    void someEventHandler(DateTime time)
    {
        if(thisIsCurrentPage)
        {
            clock.Update(time);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build a WPF application (using C#.net) in which I want
In my rails application I'm trying to build a simple FAQ page that has
Greetings! I am trying to build an application which has a flex front-end and
I'm trying to build an application that will have the following parameters: 1) 2
I'm trying to build a custom clock view in Android. See image http://twitpic.com/1devk7 So
I was trying Build For Archiving application (from Titanium Mobile) with xCode 4.4, but
I'm trying build a method which returns the shortest path from one node to
I'm trying build an App Engine connected Android application and am having some problems
I am trying to build an application that retrieves continuous streams of xml data
I am trying to build my first CRUD application and cant get the update

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.