Created
December 6, 2011 06:41
-
-
Save biac/1437083 to your computer and use it in GitHub Desktop.
BasicToastsSample から抜粋
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class App | |
{ | |
public App() | |
{ | |
InitializeComponent(); | |
this.Suspending += new SuspendingEventHandler(OnSuspending); | |
} | |
async protected void OnSuspending(object sender, SuspendingEventArgs args) | |
{ | |
SuspendingDeferral deferral = args.SuspendingOperation.GetDeferral(); | |
await SuspensionManager.SaveAsync(); | |
deferral.Complete(); //一時停止されてもOKだという通知 | |
} | |
async protected override void OnLaunched(LaunchActivatedEventArgs args) | |
{ | |
if (args.PreviousExecutionState == ApplicationExecutionState.Terminated) | |
{ | |
// Do an asynchronous restore | |
await SuspensionManager.RestoreAsync(); | |
} | |
Window.Current.Content = new MainPage(); | |
Window.Current.Activate(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment