Which method is first called when the xaml page on the Windows phone loads by default?

I want to know which method is called by default first when the xaml page loads in a Windows Phone application and how can I change the method that should be called first at boot?

+6
source share
3 answers

To directly answer your question: Initialization is the event you are looking for.

For more information, Google is your friend:

Application Life Cycle - http://msdn.microsoft.com/en-us/windowsphonetrainingcourse_applicationlifetimewp7lab_topic2.aspx

Controls and other objects must comply with the event lifecycle standard:

http://msdn.microsoft.com/en-us/library/ms754221.aspx

-2
source

To automatically perform an action when a page loads, use this in your page constructor: -

public MainPage() { InitializeComponent(); Loaded += (s, e) => { //write logic here } } 
+12
source

You can also install the Loaded handler via xaml:

.xaml:

 <Page ... Loaded="OnPageLoaded"> 

.xaml.cs:

 private void OnPageLoaded(object sender, RoutedEventArgs e) { ... } 
+2
source

Source: https://habr.com/ru/post/951688/


All Articles