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
WinRT How to check if the application was suspended?
-
28-06-2022 - |
Domanda
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...
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow