locked
How to know metro app Initialization finished?

    Question

  • I want to what time metro app initialization finish or have what event?

    thanks!

    Monday, December 5, 2011 2:57 AM

Answers

All replies

  • The MainPage Loaded event can notify the application finish its initialization.

    Or in the App class, the current application class has two methods we can override:

    can do notify the app initialization finish too.

    App.xaml.h

        ref class App
        {
        public:
            virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ pArgs);
            virtual void OnInitialize() override;
        };
    

    App.xaml.cpp:

    void App::OnInitialize()
    {
        //TO DO...
    }
    
    void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ pArgs)
    {
        Window::Current->Content = ref new MainPage();
        Window::Current->Activate();
    
        //TO DO...
    }
    

     

    Sincerely,


    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us
    Tuesday, December 6, 2011 7:53 AM
  • I want to know what time "MainPage" page show finished.

    thanks!


    Tuesday, December 6, 2011 8:09 AM
  • Well, the MainPage.Loaded can show the correct time. http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.frameworkelement.loaded.aspx
    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us
    • Marked as answer by hot_blood2001 Tuesday, December 6, 2011 9:00 AM
    Tuesday, December 6, 2011 8:37 AM
  • very thankful!
    Tuesday, December 6, 2011 9:00 AM