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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:46:20+00:00 2026-06-12T01:46:20+00:00

I am using C#, Silverlight, WP7. I am trying to add an overlay to

  • 0

I am using C#, Silverlight, WP7.

I am trying to add an overlay to my app (similar to this) that overlays at the end of each series of LayoutUpdated events.

The first problem is that LayoutUpdated gets fired multiple times on each control event, whether it’s just loading the app or scrolling or pivoting. I need to execute my code after the last LayoutUpdated event. According to this question, doing a BeginInvoke on the Loaded event will allow my code to wait for all events to finish firing. Is my understanding of this correct?

The other problem is updating the layout…on a LayoutUpdated event. This question says there will be an infinite loop of LayoutUpdated events firing, and that the solution is to set a hasChanged flag. But the flag needs to be reset by something so that on the next control event, right?

I’m confused how to implement a solution that solves both of these questions.
Thanks in advance.

  • 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-12T01:46:21+00:00Added an answer on June 12, 2026 at 1:46 am

    I ended up solving both issues with one solution. I added a variable to keep track of the last time this method was called, and if it hasn’t been called within a threshold (say 500ms), it adds the method to the dispatcher.

    This ensures that whether the LayoutUpdated event is called once or multiple times, the method will execute once regardless. I initialize the variable to the beginning of time so that even the first call will execute.

    Here is my code:

    public class DesignChecker 
    {
        private static DateTime lastCallTime = Datetime.MinValue;
        private static int minTimeSpan = 500; //set this threshold to your own needs
        public static void designChecker()
        {
            DateTime curTime = DateTime.UtcNow;
            TimeSpan span = curTime - lastCallTime;
            if (span.TotalMilliseconds < minTimeSpan)
            {
                lastCallTime = curTime;
            }
            else
            {
                lastCallTime = curTime;
                Deployment.Current.Dispatcher.BeginInvoke(() =>
                    {
                        doDesignCheck();
                    });
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am trying to put a end-user license agreement (EULA) into a WP7 silverlight
I writing wp7 silverlight app. I have a listbox with items. I want each
I am using c#, Silverlight, WP7. I have a Pivot in my app, and
I'm building this WP7 app that uses a video game API to get the
I am developing a music player in wp7 using silverlight.My end users don't have
I have a several MenuItem's inside a ContextMenu in my wp7 app using silverlight.
I'm trying to draw a circle in WP7 Silverlight using EllipseGeometry instead of Ellipse.
I'm developing a Silverlight WP7 app using MVVM Light Toolkit which initially works properly.
I'm using Silverlight Beta 4 for a LOB application. After finding out today that
I have just started trying to build my first wp7 app, and I am

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.