Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

which method is first called when a xaml page is loaded in windows phone by default?

I want to know which method is first called by default when a xaml page is loaded in windows phone app and how can I change the method which has to be called first on load?

like image 783
Nitish Bangad Avatar asked Aug 14 '13 05:08

Nitish Bangad


1 Answers

To automatically perform an action on page load, use this in your page constructor:-

public MainPage()
{
    InitializeComponent();

    Loaded += (s, e) =>
    {
        //write logic here
    }
}
like image 146
Rajeev Bhatia Avatar answered Oct 26 '22 09:10

Rajeev Bhatia