Invoked when the application is activated to display search results. ' ' Details about the activation request. Protected ...

        ''' 
        ''' Invoked when the application is activated to display search results.
        ''' 
        ''' Details about the activation request.
        Protected Overrides Async Sub OnSearchActivated(args As Windows.ApplicationModel.Activation.SearchActivatedEventArgs)

            ' TODO: Register the Windows.ApplicationModel.Search.SearchPane.GetForCurrentView().QuerySubmitted
            ' event in OnWindowCreated to speed up searches once the application is already running

            ' If the Window isn't already using Frame navigation, insert our own Frame
            Dim previousContent As UIElement = Window.Current.Content
            Dim frame As Frame = TryCast(previousContent, Frame)

            ' If the app does not contain a top-level frame, it is possible that this 
            ' is the initial launch of the app. Typically this method and OnLaunched 
            ' in App.xaml.vb can call a common method.
            If frame Is Nothing Then

                ' Create a Frame to act as the navigation context and associate it with
                ' a SuspensionManager key
                frame = New Frame
                Common.SuspensionManager.RegisterFrame(frame, "AppFrame")

                If args.PreviousExecutionState = ApplicationExecutionState.Terminated Then
                    ' Restore the saved session state only when appropriate
                    Try
                        Await Common.SuspensionManager.RestoreAsync()
                    Catch ex As Common.SuspensionManagerException
                        ' Something went wrong restoring state.
                        ' Assume there is no state and continue
                    End Try
                End If
            End If

            frame.Navigate(GetType($safeitemname$), args.QueryText)
            Window.Current.Content = frame

            ' Ensure the current window is active
            Window.Current.Activate()
        End Sub