OnNavigatedTo vs Load event

前端 未结 3 1726
孤独总比滥情好
孤独总比滥情好 2020-12-31 22:20

In several online examples I found this:

public partial class ForecastPage : PhoneApplicationPage
{
    Forecast forecast;

    public ForecastPage()
    {
          


        
3条回答
  •  情书的邮戳
    2020-12-31 22:29

    Reading from documentation about OnNavigatedTo:

    Called when a page becomes the active page in a frame.

    and when we read about Loaded event see:

    Occurs when a FrameworkElement has been constructed and added to the object tree.

    They are completely different, as page, correct me if I'm wrong, can become active more then one time during the lifetime of your application, but constuction of the FrameworkElement usually happens once.

提交回复
热议问题