문제

I have done the LoadState and SaveState and all works fine.

I just want to check in the page's constructor if I came from suspension or not... I can do a global bool variable and when I enter to the LoadState to change it's value:

bool suspended;

protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState)
{
    ...

    if (pageState != null)
    {
         suspended = true;
         ...
    }
}

public MainPage()
{
    this.InitializeComponent();

    if (!suspended)
    {
        ...
    }
}

This works fine, but is there something build in? I think I can check it without global variable...

도움이 되었습니까?

해결책

In App.xaml.cs OnLaunched(LaunchActivatedEventArgs args) event can provide you that details. You just have to pass args while navigating to particular page. args has property called PreviousExecutionState

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top