Inheritance: ISearchActivatedEventArgs, IActivatedEventArgs
Exemple #1
0
 public Splash(SearchActivatedEventArgs args)
     : this(args.SplashScreen)
 {
     AllowResume = false;
     this.GotoType = typeof(Contracts.Search);
     this.GotoParam = args.QueryText;
 }
        protected override async void OnSearchActivated(SearchActivatedEventArgs args)
        {
            var previousContent = Window.Current.Content;
            var frame = previousContent as Frame;

            if (frame == null)
            {
                frame = new Frame();
                SuspensionManager.RegisterFrame(frame, "AppFrame");

                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    try
                    {
                        await SuspensionManager.RestoreAsync();
                    }
                    catch (SuspensionManagerException)
                    {
                        // Something went wrong restoring state.
                        // Assume there is no state and continue
                    }
                }
            }

            ActiveSearchResultsPage(frame, args.QueryText);
        }
        /// <summary>
        /// Invoked when the application is activated to display search results.
        /// </summary>
        /// <param name="args">Details about the activation request.</param>
        protected override async void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            DataSource = new KhanDataSource();
            await DataSource.LoadAllData();

            KhanAcademy.SearchResultsPage.Activate(args.QueryText, args.PreviousExecutionState);
        }
Exemple #4
0
        /// <summary>
        /// Invoked when the application is activated to display search results.
        /// </summary>
        /// <param name="args">Details about the activation request.</param>
        protected async override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            var previousContent = Window.Current.Content;
            var frame           = previousContent as Frame;

            if (frame == null)
            {
                frame = new Frame();
                SuspensionManager.RegisterFrame(frame, "searchFrame");

                TopTenApp.Common.SuspensionManager.RegisterFrame(frame, "AppFrame");

                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // Restore the saved session state only when appropriate
                    try
                    {
                        await TopTenApp.Common.SuspensionManager.RestoreAsync();
                    }
                    catch (TopTenApp.Common.SuspensionManagerException)
                    {
                        //Something went wrong restoring state.
                        //Assume there is no state and continue
                    }
                }
            }

            frame.Navigate(typeof(SearchResultsPage), args.QueryText);
            Window.Current.Content = frame;

            // Ensure the current window is active
            Window.Current.Activate();
        }
 protected override void OnSearchActivated(SearchActivatedEventArgs args)
 {
     var searchTerm = args.QueryText;
     //var vm = (Resources["Locator"] as ViewModelLocator).Main;
     //vm.LoadTweetsFromSearch(searchTerm);
     ActivatePage(searchTerm);
 }
Exemple #6
0
        protected override async void OnSearchActivated(SearchActivatedEventArgs args)
        {
            // TODO: Add "Search" in the "Declarations" section of Package.appxmanifest
            await InitializeFrameAsync(args.PreviousExecutionState);

            // TODO: Implement this directly in App.xaml.cs
            SearchSamplePage.OnSearchActivated(args);
        }
Exemple #7
0
        /// <summary>
        /// Invoked when the application is activated to display search results.
        /// </summary>
        /// <param name="args">Details about the activation request.</param>
        protected async override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            await PrepareWindow(args);

            //RootFrame.Navigate(typeof(SearchResultsPage), args.QueryText);

            // Ensure the current window is active
            Window.Current.Activate();
        }
Exemple #8
0
		protected override async void OnSearchActivated(SearchActivatedEventArgs args)
		{
			await ActivateApplication(args);

			if (args.QueryText != "")
			{
				await ((Window.Current.Content as Frame).Content as MainPage).SearchFor(args.QueryText);
			}
		}
Exemple #9
0
        protected override void OnSearchActivated(SearchActivatedEventArgs args)
        {
            var frame = Window.Current.Content as Frame;
            if (frame == null)
            {
                StartApplication();
            }

            _shellViewModel.SendSearchQueryMessage(args.QueryText);
        }
Exemple #10
0
        /// <summary>
        /// Invoked when the application is activated to display search results.
        /// </summary>
        /// <param name="args">Details about the activation request.</param>
        protected override async void OnSearchActivated(
            Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            // 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
            var previousContent = Window.Current.Content;
            var frame           = previousContent as 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.cs can call a common method.
            if (frame == null)
            {
                // Create a Frame to act as the navigation context and associate it with
                // a SuspensionManager key
                frame = new Frame();
                PizzaMapPoint.Common.SuspensionManager.RegisterFrame(frame, "AppFrame");

                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // Restore the saved session state only when appropriate
                    try
                    {
                        await PizzaMapPoint.Common.SuspensionManager.RestoreAsync();
                    }
                    catch (PizzaMapPoint.Common.SuspensionManagerException)
                    {
                        //Something went wrong restoring state.
                        //Assume there is no state and continue
                    }
                }
            }

            if (args.QueryText != "")
            {
                GlobalConfig.QueryText = args.QueryText;
                try
                {
                    HttpRequest.LoadCoordinatesDataAsync(args.QueryText);
                    frame.Navigate(typeof(SearchResultsPage));
                }
                catch (Exception)
                {
                    Helper.ErrorMessage.MessageBox("Please check your internet connection and try again later.");
                }
            }

            Window.Current.Content = frame;

            // Ensure the current window is active
            Window.Current.Activate();
        }
Exemple #11
0
 /// <summary>
 /// This is the handler for Search activation.
 /// </summary>
 /// <param name="args">This is the list of arguments for 
 /// search activation, including QueryText and Language</param>
 protected override void OnSearchActivated(SearchActivatedEventArgs args)
 {
     this.EnsureMainPageActivated(args, null);
     if (args.QueryText != "")
     {
         // display search results.
         Frame rootFrame = Window.Current.Content as Frame;
         rootFrame.Navigate(typeof(MainPage));
         MainPage.Current.RefreshGridWithSearchResults(args.QueryText);
     }
 }
Exemple #12
0
        /// <summary>
        /// Invoked when the application is activated to display search results.
        /// </summary>
        /// <param name="args">Details about the activation request.</param>
        protected async override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            // TODO: Register the Windows.ApplicationModel.Search.SearchPane.GetForCurrentView().QuerySubmitted
            // event in OnWindowCreated to speed up searches once the application is already running
            // Reinitialize the app if a new instance was launched for search
            if (args.PreviousExecutionState == ApplicationExecutionState.NotRunning ||
                args.PreviousExecutionState == ApplicationExecutionState.ClosedByUser ||
                args.PreviousExecutionState == ApplicationExecutionState.Terminated)
            {
                // Load recipe data
                await RecipeDataSource.LoadLocalDataAsync();

                // Register handler for SuggestionsRequested events from the search pane
                SearchPane.GetForCurrentView().SuggestionsRequested += OnSuggestionsRequested;

                // Register handler for CommandsRequested events from the settings pane
                SettingsPane.GetForCurrentView().CommandsRequested += OnCommandsRequested;
            }

            // If the Window isn't already using Frame navigation, insert our own Frame
            var previousContent = Window.Current.Content;
            var frame           = previousContent as 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.cs can call a common method.
            if (frame == null)
            {
                // Create a Frame to act as the navigation context and associate it with
                // a SuspensionManager key
                frame = new Frame();
                ContosoCookbook.Common.SuspensionManager.RegisterFrame(frame, "AppFrame");

                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // Restore the saved session state only when appropriate
                    try
                    {
                        await ContosoCookbook.Common.SuspensionManager.RestoreAsync();
                    }
                    catch (ContosoCookbook.Common.SuspensionManagerException)
                    {
                        //Something went wrong restoring state.
                        //Assume there is no state and continue
                    }
                }
            }

            frame.Navigate(typeof(SearchResultsPage), args.QueryText);
            Window.Current.Content = frame;

            // Ensure the current window is active
            Window.Current.Activate();
        }
 protected override async void OnSearchActivated(SearchActivatedEventArgs args)
 {
     try
     {
         await EnsureShell(args.PreviousExecutionState);
         await ViewModelLocator.Hub.Send(new SearchIssuesMessage(args.QueryText));
     }
     catch(Exception error)
     {
         ((App)App.Current).OnUnhandledException(error);
     }
 }
Exemple #14
0
        protected override void OnSearchActivated(SearchActivatedEventArgs args)
        {
            base.OnSearchActivated(args);

            var view = new SearchView();
            var viewModel = new SearchViewModel();
            viewModel.SearchText = args.QueryText;
            view.DataContext = viewModel;

            Window.Current.Content = view;
            Window.Current.Activate();
        }
Exemple #15
0
        protected override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            //// 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
            //var previousContent = Window.Current.Content;
            //var frame = previousContent as 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.cs can call a common method.
            //if (frame == null)
            //{
            //    // Create a Frame to act as the navigation context and associate it with
            //    // a SuspensionManager key
            //    frame = new Frame();
            //    IPlayer.Common.SuspensionManager.RegisterFrame(frame, "AppFrame");

            //    if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
            //    {
            //        // Restore the saved session state only when appropriate
            //        try
            //        {
            //            await IPlayer.Common.SuspensionManager.RestoreAsync();
            //        }
            //        catch (IPlayer.Common.SuspensionManagerException)
            //        {
            //            //Something went wrong restoring state.
            //            //Assume there is no state and continue
            //        }
            //    }
            //}

            //frame.Navigate(typeof(MainPage), args);
            //Window.Current.Content = frame;

            //// Ensure the current window is active
            //Window.Current.Activate();

            Frame f = (Frame)Window.Current.Content;

            if (f == null)
            {
                Frame frame = new Frame();
                frame.Navigate(typeof(Views.MainPage), args);
                Window.Current.Content = frame;

                // Ensure the current window is active
                Window.Current.Activate();
            }
        }
Exemple #16
0
 /// <summary>
 /// This is the handler for Search activation.
 /// </summary>
 /// <param name="args">This is the list of arguments for search activation, including QueryText and Language</param>
 async protected override void OnSearchActivated(SearchActivatedEventArgs args)
 {
     await EnsureMainPageActivatedAsync(args);
     if (args.QueryText == "")
     {
         // navigate to landing page.
     }
     else
     {
         // display search results.
         MainPage.Current.ProcessQueryText(args.QueryText);
     }
 }
        // Search contract implementation
        public static async void OnSearchActivated(SearchActivatedEventArgs args)
        {
            // TODO: Implement this directly in App.xaml.cs

            var frame = (MtFrame)Window.Current.Content;
            var page = frame.CurrentPage.Page as SearchSamplePage;
            if (page == null)
            {
                await frame.NavigateAsync(typeof(SearchSamplePage));
                page = (SearchSamplePage)frame.CurrentPage.Page;
            }

            page.Initialize(args);
        }
Exemple #18
0
 /// <summary>
 /// This is the handler for Search activation.
 /// </summary>
 /// <param name="args">This is the list of arguments for search activation, including QueryText and Language</param>
 async protected override void OnSearchActivated(SearchActivatedEventArgs args)
 {
     // TODO: called every time a Search query is send to the App via the Search Charm
     //       --> same workflow if the App is running or not
     await EnsureMainPageActivatedAsync(args);
     if (args.QueryText == "")
     {
         // navigate to landing page.
     }
     else
     {
         // display search results.
         MainPage.Current.ProcessQueryText(args.QueryText);
     }
 }
 protected override async void OnSearchActivated(SearchActivatedEventArgs args)
 {
     try
     {
         await EnsureShell(args.PreviousExecutionState);
         await ViewModelLocator.Hub.Send(new SearchQuerySubmittedMessage(args.QueryText));
     }
     catch (Exception ex)
     {
         // Due to an issues I've noted online: http://social.msdn.microsoft.com/Forums/en/winappswithcsharp/thread/bea154b0-08b0-4fdc-be31-058d9f5d1c4e
         // I am limiting the use of 'async void'  In a few rare occasions I use it
         // and manually route the exceptions to the UnhandledExceptionHandler
         ((App)App.Current).OnUnhandledException(ex);
     }
 }
Exemple #20
0
        /// <summary>
        /// Invoked when the application is activated to display search results.
        /// </summary>
        /// <param name="args">Details about the activation request.</param>
        protected async override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            // TODO: Register the Windows.ApplicationModel.Search.SearchPane.GetForCurrentView().QuerySubmitted
            // event in OnWindowCreated to speed up searches once the application is already running
            // Reinitialize the app if a new instance was launched for search

            // Load data silently; if it is not available, just give up!
            await TunesDataSource.Load();

            await Navigate(typeof(SearchResultsPage), args.QueryText, args.PreviousExecutionState, NavigationReplacementMode.AlwaysReplace, false);

            // Clean artwork cache if possible
            AppData.Settings.CleanArtworkCache();

            // Load settings charm
            SettingsUIManager.LoadSettingsCharm();
        }
Exemple #21
0
        /// <summary>
        /// Invoked when the application is activated to display search results.
        /// </summary>
        /// <param name="args">Details about the activation request.</param>
        protected async override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            // Reinitialize the app if a new instance was launched for search
            if (args.PreviousExecutionState == ApplicationExecutionState.NotRunning ||
                args.PreviousExecutionState == ApplicationExecutionState.ClosedByUser ||
                args.PreviousExecutionState == ApplicationExecutionState.Terminated)
            {
                await CommonInitialize();
            }

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

            await EnsureRootFrameInitialization(args.PreviousExecutionState, Window.Current.Content as Frame);

            NavigationService.Navigate <SearchResultsPage>(args.QueryText);
            Window.Current.Activate();
        }
        /// <summary>
        /// Invoked when the application is activated to display search results.
        /// </summary>
        /// <param name="args">Details about the activation request.</param>
        protected async override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            // 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
            var previousContent = Window.Current.Content;
            var frame           = previousContent as 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.cs can call a common method.
            if (frame == null)
            {
                // Create a Frame to act as the navigation context and associate it with
                // a SuspensionManager key
                frame = new Frame();
                Reyx.Win8.PeriodicTable.Common.SuspensionManager.RegisterFrame(frame, "AppFrame");

                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // Restore the saved session state only when appropriate
                    try
                    {
                        await Reyx.Win8.PeriodicTable.Common.SuspensionManager.RestoreAsync();
                    }
                    catch (Reyx.Win8.PeriodicTable.Common.SuspensionManagerException)
                    {
                        //Something went wrong restoring state.
                        //Assume there is no state and continue
                    }
                }
            }

            searchPane.SuggestionsRequested += new TypedEventHandler <SearchPane, SearchPaneSuggestionsRequestedEventArgs>(OnSearchPaneSuggestionsRequested);

            frame.Navigate(typeof(SearchResultsPage), args.QueryText);
            Window.Current.Content = frame;

            // Ensure the current window is active
            Window.Current.Activate();
        }
Exemple #23
0
        /// <summary>
        /// Invoked when the application is activated to display search results.
        /// </summary>
        /// <param name="args">Details about the activation request.</param>
        protected async override void OnSearchActivated(SearchActivatedEventArgs args)
        {
            // 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
            var previousContent = Window.Current.Content;
            var frame = previousContent as 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.cs can call a common method.
            if (frame == null)
            {
                // Create a Frame to act as the navigation context and associate it with
                // a SuspensionManager key
                frame = new Frame();
                SuspensionManager.RegisterFrame(frame, "AppFrame");

                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // Restore the saved session state only when appropriate
                    try
                    {
                        await SuspensionManager.RestoreAsync();
                    }
                    catch (SuspensionManagerException)
                    {
                        //Something went wrong restoring state.
                        //Assume there is no state and continue
                    }
                }
            }

            frame.Navigate(typeof(SearchResultsPage), args.QueryText);
            Window.Current.Content = frame;

            // Ensure the current window is active
            Window.Current.Activate();
        }
Exemple #24
0
        /// <summary>
        /// 在啟用應用程式以顯示搜尋結果時叫用。
        /// </summary>
        /// <param name="args">有關啟用要求的詳細資料。</param>
        protected async override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            // TODO: 在 OnWindowCreated 中註冊 Windows.ApplicationModel.Search.SearchPane.GetForCurrentView().QuerySubmitted
            // 事件,以加速已經執行之應用程式的搜尋速度

            // 如果視窗尚未使用框架巡覽,則插入我們自己的框架
            var previousContent = Window.Current.Content;
            var frame           = previousContent as Frame;

            // 如果應用程式不包含最上層框架,這可能是
            // 應用程式的初始啟動。一般而言,這個方法和 App.xaml.cs 中的 OnLaunched
            // 可以呼叫共同的方法。
            if (frame == null)
            {
                // 建立框架做為巡覽內容,並與
                // SuspensionManager 機碼產生關聯
                frame = new Frame();
                OurSecrets.Common.SuspensionManager.RegisterFrame(frame, "AppFrame");

                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // 只在適當時還原儲存的工作階段狀態
                    try
                    {
                        await OurSecrets.Common.SuspensionManager.RestoreAsync();
                    }
                    catch (OurSecrets.Common.SuspensionManagerException)
                    {
                        //發生狀況,還原狀態。
                        //假定沒有狀態,並繼續
                    }
                }
            }

            //frame.Navigate(typeof(SearchResultsPage1), args.QueryText);
            Window.Current.Content = frame;

            // 確定目前視窗是作用中
            Window.Current.Activate();
        }
Exemple #25
0
        /// <summary>
        /// 在激活应用程序以显示搜索结果时调用。
        /// </summary>
        /// <param name="args">有关激活请求的详细信息。</param>
        protected async override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            // TODO: 在 OnWindowCreated 中注册 Windows.ApplicationModel.Search.SearchPane.GetForCurrentView().QuerySubmitted
            // 事件,以在应用程序运行后加快搜索

            // 如果窗口尚未使用框架导航,则插入我们自己的框架
            var previousContent = Window.Current.Content;
            var frame           = previousContent as Frame;

            // 如果应用程序不包含顶级框架,则可能表示这是
            // 初次启动应用程序。一般而言,此方法和 App.xaml.cs 中的 OnLaunched
            // 可调用公共方法。
            if (frame == null)
            {
                // 创建要充当导航上下文的框架,并将其与
                // SuspensionManager 键关联
                frame = new Frame();
                Catfish.Common.SuspensionManager.RegisterFrame(frame, "AppFrame");

                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // 仅当适用时还原保存的会话状态
                    try
                    {
                        await Catfish.Common.SuspensionManager.RestoreAsync();
                    }
                    catch (Catfish.Common.SuspensionManagerException)
                    {
                        //还原状态时出现问题。
                        //假定没有状态并继续
                    }
                }
            }

            frame.Navigate(typeof(Index), args.QueryText);
            Window.Current.Content = frame;

            // 确保当前窗口处于活动状态
            Window.Current.Activate();
        }
Exemple #26
0
        /// <summary>
        /// Invoked when the application is activated to display search results.
        /// </summary>
        /// <param name="args">Details about the activation request.</param>
        protected async override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            // get the name of the app from the mainfest
            DisplayName = (await AppManifestHelper.GetManifestVisualElementsAsync()).DisplayName;

            // If the Window isn't already using Frame navigation, insert our own Frame
            var previousContent = Window.Current.Content;
            var frame           = previousContent as 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.cs can call a common method.
            if (frame == null)
            {
                // Create a Frame to act as the navigation context and associate it with
                // a SuspensionManager key
                frame = new Frame();
                SuspensionManager.RegisterFrame(frame, "AppFrame");

                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // Restore the saved session state only when appropriate
                    try
                    {
                        await SuspensionManager.RestoreAsync();
                    }
                    catch (SuspensionManagerException)
                    {
                        //Something went wrong restoring state.
                        //Assume there is no state and continue
                    }
                }
            }

            frame.Navigate(typeof(LocationSearchResultsPage), args.QueryText);
            Window.Current.Content = frame;

            // Ensure the current window is active
            Window.Current.Activate();
        }
Exemple #27
0
        /// <summary>
        /// Вызывается при активации приложения для отображения результатов поиска.
        /// </summary>
        /// <param name="args">Сведения о запросе на активацию.</param>
        protected async override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            // TODO: Регистрация события Windows.ApplicationModel.Search.SearchPane.GetForCurrentView().QuerySubmitted
            // в OnWindowCreated для ускорения поиска во время выполнения приложения

            // Если в окне еще не используется навигация по фреймам, вставьте собственный фрейм
            var previousContent = Window.Current.Content;
            var frame           = previousContent as Frame;

            // Если приложение не содержит фрейм верхнего уровня, то, возможно, это
            // первый запуск приложения. Обычно этот метод и метод OnLaunched
            // из файла App.xaml.cs могут вызывать общий метод.
            if (frame == null)
            {
                // Создание фрейма, играющего роль контекста навигации, и его связывание с
                // ключом SuspensionManager
                frame = new Frame();
                RybinskTaxi.Common.SuspensionManager.RegisterFrame(frame, "AppFrame");

                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // Восстановление сохраненного состояния сеанса только при необходимости
                    try
                    {
                        await RybinskTaxi.Common.SuspensionManager.RestoreAsync();
                    }
                    catch (RybinskTaxi.Common.SuspensionManagerException)
                    {
                        //Возникли ошибки при восстановлении состояния.
                        //Предполагаем, что состояние отсутствует, и продолжаем
                    }
                }
            }

            frame.Navigate(typeof(TaxiSearch), args.QueryText);
            Window.Current.Content = frame;

            // Обеспечение активности текущего окна
            Window.Current.Activate();
        }
        public SplashPage(SplashScreen splash, object args)
        {
            _splash = splash;

            if (args is LaunchActivatedEventArgs)
            {
                _activationArgs = args as LaunchActivatedEventArgs;
            }
            else
            {
                _searchArgs = args as SearchActivatedEventArgs;
            }

            Loaded += ExtendedSplashScreen_Loaded;
            Window.Current.SizeChanged += Current_SizeChanged;

            InitializeComponent();
            PositionElements();
            App.Instance.RegisterForShare();

            flyLogin.LoginSuccess += flyLogin_LoginSuccess;

        }
        /// <summary>
        /// Invoked when the application is activated to display search results.
        /// </summary>
        /// <param name="args">Details about the activation request.</param>
        protected override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            var previousContent = Window.Current.Content;
            var frame           = previousContent as 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.cs can call a common method.
            if (frame == null)
            {
                frame = new Frame();
                Window.Current.Content = frame;

                frame.Navigate(typeof(MainPage), args.QueryText);
            }
            else
            {
                MainPage mainPage = frame.Content as MainPage;
                mainPage.NavigateToPageControlByArguments(args.QueryText);
            }

            Window.Current.Activate();
        }
        /// <summary>
        /// Invoked when the application is activated to display search results.
        /// </summary>
        /// <param name="args">Details about the activation request.</param>
        protected async override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            // TODO: Register the Windows.ApplicationModel.Search.SearchPane.GetForCurrentView().QuerySubmitted
            // event in OnWindowCreated to speed up searches once the application is already running
            if (await CoreData.Initialize())
            {
                //iterate through the folder and get all timetables
                if (await CoreData.GetTimetables())
                {
                }
            }
            else
            {
                //if something happened then suggest a fix for the user
                MessageDialog dialog = new MessageDialog("There was a problem initializing the data storage.\nTry closing and reopening the app.", "Oops");
                await dialog.ShowAsync();
            }
            // If the Window isn't already using Frame navigation, insert our own Frame
            var previousContent = Window.Current.Content;
            var frame           = previousContent as 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.cs can call a common method.
            if (frame == null)
            {
                // Create a Frame to act as the navigation context and associate it with
                // a SuspensionManager key
                frame = new Frame();
            }

            frame.Navigate(typeof(SearchResultsPage), args.QueryText);
            Window.Current.Content = frame;

            // Ensure the current window is active
            Window.Current.Activate();
        }
Exemple #31
0
        /// <summary>
        /// Invoked when the application is activated to display search results.
        /// </summary>
        /// <param name="args">Details about the activation request.</param>
        protected override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            var previousContent = Window.Current.Content;
            var frame           = previousContent as Frame;

            if (frame != null)
            {
                // If the app is already running and uses top-level frame navigation we can just
                // navigate to the search results
                frame.Navigate(typeof(SearchResultPage), args.QueryText);
            }
            else
            {
                // Otherwise bypass navigation and provide the tools needed to emulate the back stack
                //SearchResultsView page = new SearchResultsView();
                //page._previousContent = previousContent;
                //page._previousExecutionState = previousExecutionState;
                //page.LoadState( queryText, null );
                //Window.Current.Content = page;
            }

            // Either way, active the window
            Window.Current.Activate();
        }
Exemple #32
0
 /// <summary>
 /// Invoked when the application is activated to display search results.
 /// </summary>
 /// <param name="args">Details about the activation request.</param>
 protected override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
 {
     ContosoCookbook.SearchResultsPage1.Activate(args.QueryText, args.PreviousExecutionState);
 }
Exemple #33
0
 /// <summary>
 /// Invoked when the application is activated to display search results.
 /// </summary>
 /// <param name="args">Details about the activation request.</param>
 protected override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
 {
     SimpleSearchProvider.SearchResultsPage.Activate(args.QueryText, args.PreviousExecutionState);
 }
Exemple #34
0
        /// <summary>
        /// Invoked when the application is activated to display search results.
        /// </summary>
        /// <param name="args">Details about the activation request.</param>
        protected async override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
        {
            try
            {
                // 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
                var previousContent = Window.Current.Content;
                var frame           = previousContent as 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.cs can call a common method.
                if (frame == null)
                {
                    // Create a Frame to act as the navigation context and associate it with
                    // a SuspensionManager key
                    frame = new Frame();
                    SuspensionManager.RegisterFrame(frame, "appFrame");

                    if (args.PreviousExecutionState == ApplicationExecutionState.Terminated ||
                        args.PreviousExecutionState == ApplicationExecutionState.ClosedByUser ||
                        args.PreviousExecutionState == ApplicationExecutionState.NotRunning)
                    {
                        // Restore the saved session state only when appropriate
                        try
                        {
                            await SuspensionManager.RestoreAsync();

                            if (StorageSettings.MailHeaderDictionary.AllEmailCount == 0)
                            {
                                throw new Exception("Mail header dictionary data missing.");
                            }
                        }
                        catch (SuspensionManagerException ex)
                        {
                            //Something went wrong restoring state.
                            //Assume there is no state and continue
                            LogFile.Instance.LogError("", "", ex.ToString());
                            IsSessionStateCorrupted = true;
                        }
                    }
                }

                // Show progress ring
                MainPage.Current.ResetEmailHeaderProgressRingState(MainPage.Current.SelectedMailClient, MainPage.Current.SelectedMailbox, true);

                // Reset email header state
                MainPage.Current.ResetEmailHeaderFilterState(true, args.QueryText);

                // Bind mail header
                await MainPage.Current.BindMailHeaderAsync(MainPage.Current.SelectedMailClient.AccountSettingsData, MainPage.Current.SelectedMailbox, args.QueryText);

                // Hide progress ring
                MainPage.Current.ResetEmailHeaderProgressRingState(MainPage.Current.SelectedMailClient, MainPage.Current.SelectedMailbox, false);

                // Ensure the current window is active
                Window.Current.Activate();
            }
            catch (Exception ex)
            {
                LogFile.Instance.LogError("", "", ex.ToString());
            }
        }
Exemple #35
0
        protected async override void OnSearchActivated(SearchActivatedEventArgs args)
        {
            base.OnSearchActivated(args);
            string data = args.QueryText;
            if (args.PreviousExecutionState == ApplicationExecutionState.NotRunning)
            {
                await PageStart(args, data);    //App.xml.cs中定义的私有方法,下面有介绍
                return;
            }
            {
                await EnsureSearchPageActive(args);
            }
           
           // ViewModel.ViewModelLocator.AppViewModel.Main.SearchManga(args.QueryText);

        }
Exemple #36
0
        protected override async void OnSearchActivated(SearchActivatedEventArgs args)
        {
            UIElement previousContent = Window.Current.Content;
            var frame = previousContent as Frame;
            if (frame == null)
            {
                frame = new Frame();
                SuspensionManager.RegisterFrame(frame, "AppFrame");

                if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    try
                    {
                        await SuspensionManager.RestoreAsync();
                    }
                    catch (SuspensionManagerException)
                    {
                    }
                }
            }

            frame.Navigate(typeof (SearchView), args.QueryText);
            Window.Current.Content = frame;

            Window.Current.Activate();
        }
        /// <summary>
        /// Invoked when the application is activated through a search association.
        /// </summary>
        /// <param name="args">Event data for the event.</param>
        // Documentation on using search is at http://go.microsoft.com/fwlink/?LinkID=288822&clcid=0x409
        protected async override void OnSearchActivated(SearchActivatedEventArgs args)
        {
            // If the Window isn't already using Frame navigation, insert our own Frame
            var rootFrame = await InitializeFrameAsync(args);

            if (rootFrame != null)
            {
                var searchQueryArguments = new SearchQueryArguments(args);
                OnSearchApplication(searchQueryArguments);
            }

            // Ensure the current window is active
            Window.Current.Activate();
        }
 protected sealed override async void OnSearchActivated(SearchActivatedEventArgs args) { await Activated(args); } 
Exemple #39
0
 /// <summary>
 /// Appelé lorsque l'application est activée pour afficher les résultats de la recherche.
 /// </summary>
 /// <param name="args">Détails relatifs à la requête d'activation.</param>
 protected override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
 {
     main.navagiteur.Frame.Navigate(typeof(SearchFriend), args.QueryText);
 }
        protected override void OnSearchActivated(SearchActivatedEventArgs args)
        {
            base.OnSearchActivated(args);

            var searchResultsPage = new SearchResultsPage();
            ((SearchResultsViewModel)searchResultsPage.DataContext).PerformSearchAsync(args.QueryText);

            WindowManager.NavigateTo(searchResultsPage);
        }
 /// <summary>
 /// This is the handler for Search activation.
 /// </summary>
 /// <param name="args">This is the list of arguments for search activation, including QueryText and Language</param>
 protected override void OnSearchActivated(SearchActivatedEventArgs args)
 {
     if (string.IsNullOrEmpty(args.QueryText))
     {
         // navigate to landing page.
     }
     else
     {
         // display search results.
         RootFrame.Navigate(typeof(ShowListPage), new ShowListParams(MethodCall.Search, null, args.QueryText));
     }
 }
Exemple #42
0
        protected override void OnSearchActivated(SearchActivatedEventArgs args)
        {


        }
 protected override sealed async void OnSearchActivated(SearchActivatedEventArgs args)
 {
     AppStartInfo info = AppStartInfo.Default;
     await this.OnPreStartAsync(args, info);
     await this.OnSearchStartAsync(args, info);
     this.InternalStartAsync(args, info);
 }
Exemple #44
0
 protected override void OnSearchActivated(SearchActivatedEventArgs args)
 {
     InitializeSearch(args.QueryText);
 }
 protected virtual Task OnSearchStartAsync(SearchActivatedEventArgs args, AppStartInfo info)
 {
     return Task.FromResult<object>(null);
 }
Exemple #46
0
 /// <summary>
 /// Invoked when the application is activated to display search results.
 /// </summary>
 /// <param name="args">Details about the activation request.</param>
 protected override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
 {
     Movies.WinRT.Views.MovieSearchResultsPage.Activate(args.QueryText, args.PreviousExecutionState);
 }
Exemple #47
0
 /// <summary>
 /// 在激活应用程序以显示搜索结果时调用。
 /// </summary>
 /// <param name="args">有关激活请求的详细信息。</param>
 protected override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
 {
     //此重载方法在当前操作界面非本系统时,进行搜索时触发
     OpenSearchPage(args.QueryText);
 }
 protected override void OnSearchActivated(SearchActivatedEventArgs args)
 {
     base.OnSearchActivated(args);
     Activate(args);
 }
 /// <summary>
 /// Invoked when the application is activated to display search results.
 /// </summary>
 /// <param name="args">Details about the activation request.</param>
 ///
 protected override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
 {
     ActivateApplication(args);
 }
Exemple #50
0
 protected override async void OnSearchActivated(SearchActivatedEventArgs args) { await InternalActivatedAsync(args); }
Exemple #51
0
        /// <summary>
        /// This is the handler for Search activation. 
        /// </summary>
        /// <param name="args">This is the list of arguments for search activation, including QueryText and Language</param>
        protected override async void OnSearchActivated(SearchActivatedEventArgs args)
        {
            base.OnSearchActivated(args);
            await EnsureMainPageAsync(args);

            string responseText = await GetjsonStream(args.QueryText);


            JsonDataSource sampleData = ParseJson(responseText, args.QueryText);

            var rootFrame = new Frame();
            rootFrame.Navigate(typeof (GroupedItemsPage), sampleData.ItemGroups);
            Window.Current.Content = rootFrame;
        }
 protected override void OnSearchActivated(SearchActivatedEventArgs args)
 {
     //
     // ensure intialization
     //
     EnsureInitialized(null, args);
     //
     // check
     //
     if (RootFrame != null)
     {
         //
         // If the app is already running and uses top-level frame navigation we can just
         // navigate to the search results
         //
         RootFrame.Navigate(typeof(SearchResultsPage1), args.QueryText);
     }
 }
Exemple #53
0
 protected override void OnSearchActivated(SearchActivatedEventArgs args) { NavigationService.Activate(args as IActivatedEventArgs); }