且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows Phone 8 页面生命周期

更新时间:2023-01-25 17:07:39

不确定您的问题是否如下:

Not so sure if what you ask is the following:

每个 Windows Phone 页面都有一个构造方法,该方法在创建页面时仅被调用一次 - 这意味着该方法仅被调用一次.

Each Windows Phone Page has a constructor method which is called only once when the page is created - meaning that this method is called only once.

然后是 OnNavigatedTo()OnNavigatedFrom() 方法.当您从另一个页面导航到当前页面时,第一个是构造函数之后的下一个.当您导航离开当前页面时,将调用导航自 - 当此页面将添加到页面堆栈(也称为日志)时.

Then comes the OnNavigatedTo() and OnNavigatedFrom() methods. The first one is the next in line after the constructor when you are navigating from another page to the current one. The navigated from is being called while you are navigating away from the current page - when this page will be added to the page stack (a.k.a. journal).

接下来是 Loaded() 方法,该方法在 OnNavigatedTo() 方法之后调用,并且每次导航到当前页面时也会调用.

Next follows the Loaded() method which is called after the OnNavigatedTo() method and also gets called every time you navigate to the current page.

最后,您有 OnBackKeyPress()RemovedFromJournal() 方法,它们会在您尝试离开页面以及页面被破坏"时被调用.此处调用的第一个方法是 OnBackKeyPress(),然后是 RemovedFromJournal().

Finally you have the OnBackKeyPress() and RemovedFromJournal() methods that gets called when you are trying to navigate away from the page and when the page is 'destroyed'. The first method that gets called here is OnBackKeyPress() and then the RemovedFromJournal().