' The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227''' <summary>''' Provides application-specific behavior to supplement the default Application class.''' </summary>NotInheritableClass App
Inherits Application
''' <summary>''' Invoked when the application is launched normally by the end user. Other entry points''' will be used when the application is launched to open a specific file, to display''' search results, and so forth.''' </summary>''' <param name="args">Details about the launch request and process.</param>ProtectedOverridesSub OnLaunched(args As Windows.ApplicationModel.Activation.LaunchActivatedEventArgs)
Dim rootFrame As Frame = Window.Current.Content
' Do not repeat app initialization when the Window already has content,' just ensure that the window is activeIf rootFrame IsNothingThen' Create a Frame to act as the navigation context and navigate to the first page
rootFrame = New Frame()
If args.PreviousExecutionState = ApplicationExecutionState.Terminated Then' TODO: Load state from previously suspended applicationEndIf' Place the frame in the current Window
Window.Current.Content = rootFrame
EndIfIf rootFrame.Content IsNothingThen' When the navigation stack isn't restored navigate to the first page,' configuring the new page by passing required information as a navigation' parameterIfNot rootFrame.Navigate(GetType(MainPage), args.Arguments) ThenThrowNew Exception("Failed to create initial page")
EndIfEndIf' Ensure the current window is active
Window.Current.Activate()
EndSub''' <summary>''' Invoked when application execution is being suspended. Application state is saved''' without knowing whether the application will be terminated or resumed with the contents''' of memory still intact.''' </summary>''' <param name="sender">The source of the suspend request.</param>''' <param name="e">Details about the suspend request.</param>PrivateSub OnSuspending(sender AsObject, e As SuspendingEventArgs) HandlesMe.Suspending
Dim deferral As SuspendingDeferral = e.SuspendingOperation.GetDeferral()
' TODO: Save application state and stop any background activity
deferral.Complete()
EndSubEndClass