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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:04:24+00:00 2026-05-23T13:04:24+00:00

I feel silly, but I just can’t find an answer to this. Let’s say

  • 0

I feel silly, but I just can’t find an answer to this. Let’s say I want to show some message to the users when the MainPage loads. The problem is that if I do this on Loaded event (MessageBox.Show()), the popup shows just before my page is loaded which leaves the user with this message and a black background. This is kind of dull situation. Any ideas which event can do the trick. There other ways around like background worker or NavigationInTransition_EndTransition event but there should be more elegant way ?

  • 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-05-23T13:04:25+00:00Added an answer on May 23, 2026 at 1:04 pm

    You can easily test all standard methods. It took me less time than writing this text to do so.

    In page constructor:

    Loaded += new RoutedEventHandler(TestPage_Loaded);
    LayoutUpdated += new EventHandler(TestPage_LayoutUpdated);
    

    Respective methods:

        void TestPage_LayoutUpdated(object sender, EventArgs e)
        {
            Debug.WriteLine("LayoutUpdated");
        }
    
        void TestPage_Loaded(object sender, RoutedEventArgs e)
        {
            Debug.WriteLine("Loaded");
            Dispatcher.BeginInvoke(() =>
            {
                Debug.WriteLine("Loaded -> BeginInvoke");
            });
        }
    

    Add debug write to OnNavigateTo() as well.

    If your page is similarly complex than mine, then you get something like:

    1. OnNavigatedTo
    2. LayoutUpdated
    3. Loaded
    4. LayoutUpdated
    5. Loaded -> BeginInvoke
    6. many times LayoutUpdated

    Last LayoutUpdated would be the best candidate, but how would one detect it? Hence “Loaded -> BeginInvoke” seems to be the best option among the trivial ones.

    You can also use the Loaded events of individual components on your page. That’s also trivially easy. They will probably happen sometimes between 4th and 5th step.

    If none of above options helps (I don’t think so), you have to use non-standard logic. Such as above mentioned one-shot timer that shows the message after some time. Or base your logic on LayoutUpdated counter.

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

Sidebar

Related Questions

I feel very very very silly posting this, but I can't find the answer.
I feel like this is a silly question, but I can't find the answer.
I feel silly asking this, but, I just can't work out how to create
I feel quite silly asking this, but I couldn't find a definite answer anywhere.
I feel like this is a silly question but I always find that modifying
I feel really silly to not be able to find this answer anywhere. Could
Somehow I feel really silly to ask this question, but I just spent 2
Feel silly asking this question, since this should be easy, but I can't figure
Feel silly asking this question, but can't seem to change directory to Windows XP
I feel silly for asking, but how do I get plan value in this

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.