Continue() private method

Sets the ContinuationArgs for this instance. Using default Frame of current Window Should be called by the main activation handling code in App.xaml.cs
private Continue ( IContinuationActivatedEventArgs args ) : void
args IContinuationActivatedEventArgs The activation args
return void
Esempio n. 1
0
        protected override async void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);

            continuationManager = new ContinuationManager();

            Frame rootFrame = CreateRootFrame();

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(MainPage));
            }

            var continuationEventArgs = e as IContinuationActivatedEventArgs;

            if (continuationEventArgs != null)
            {
                Frame scenarioFrame = Window.Current.Content as Frame;
                if (scenarioFrame != null)
                {
                    // Call ContinuationManager to handle continuation activation
                    continuationManager.Continue(continuationEventArgs, scenarioFrame);
                }
            }

            Window.Current.Activate();
        }
Esempio n. 2
0
        /// <summary>
        /// Handle OnActivated event to deal with File Open/Save continuation activation kinds
        /// </summary>
        /// <param name="e">Application activated event arguments, it can be casted to proper sub-type based on ActivationKind</param>
        protected async override void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);

            continuationManager = new ContinuationManager();

            Frame rootFrame = CreateRootFrame();

            await RestoreStatusAsync(e.PreviousExecutionState);

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(MainPage));
            }

            if (e.Kind == ActivationKind.VoiceCommand)
            {
                //if (!((Frame)Window.Current.Content).Navigate(typeof(NordicUART), "Nordic Uart"))
                //{
                //}
                VoiceControlHandler.HandleCommand(e, rootFrame);
            }

            var continuationEventArgs = e as IContinuationActivatedEventArgs;

            if (continuationEventArgs != null)
            {
                continuationManager.Continue(continuationEventArgs, rootFrame);
            }
            Window.Current.Activate();
        }
Esempio n. 3
0
        /// <summary>
        /// Handle OnActivated event to deal with File Open/Save continuation activation kinds
        /// </summary>
        /// <param name="e">Application activated event arguments, it can be casted to proper sub-type based on ActivationKind</param>
        protected override void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);

            continuationManager = new ContinuationManager();

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(weibo_loginPage));
            }

            var continuationEventArgs = e as IContinuationActivatedEventArgs;

            if (continuationEventArgs != null)
            {
                // Call ContinuationManager to handle continuation activation
                continuationManager.Continue(continuationEventArgs, rootFrame);
            }

            Window.Current.Activate();
        }
Esempio n. 4
0
        protected override void OnActivated(IActivatedEventArgs args)
        {
            base.OnActivated(args);

            ContinuationManager = new ContinuationManager();
            ContinuationManager.Continue(args as IContinuationActivatedEventArgs);
        }
Esempio n. 5
0
        /// <summary>
        /// Handle OnActivated event to deal with File Open/Save continuation activation kinds
        /// </summary>
        /// <param name="e">Application activated event arguments, it can be casted to proper sub-type based on ActivationKind</param>
        protected async override void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);
            Debug.WriteLine("First line");
            continuationManager = new ContinuationManager();

            Frame rootFrame = CreateRootFrame();

            await RestoreStatusAsync(e.PreviousExecutionState);

            Debug.WriteLine("Second line");

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(MainPage));
            }

            var continuationEventArgs = e as IContinuationActivatedEventArgs;

            if (continuationEventArgs != null)
            {
                Frame appFrame = Window.Current.Content as Frame;
                if (appFrame != null)
                {
                    // Call ContinuationManager to handle continuation activation
                    continuationManager.Continue(continuationEventArgs, appFrame);
                }
            }
            Debug.WriteLine("Third line");

            Window.Current.Activate();
        }
        /// <summary>
        /// Handle OnActivated event to deal with File Open/Save continuation activation kinds
        /// </summary>
        /// <param name="e">Application activated event arguments, it can be casted to proper sub-type based on ActivationKind</param>
        protected async override void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);

            continuationManager = new ContinuationManager();

            Frame rootFrame = CreateRootFrame();

            await RestoreStatusAsync(e.PreviousExecutionState);

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(MainPage));
            }

            var continuationEventArgs = e as IContinuationActivatedEventArgs;

            if (continuationEventArgs != null)
            {
                Frame scenarioFrame = MainPage.Current.FindName("ScenarioFrame") as Frame;
                if (scenarioFrame != null)
                {
                    // Call ContinuationManager to handle continuation activation
                    continuationManager.Continue(continuationEventArgs, scenarioFrame);
                }
            }

            Window.Current.Activate();
        }
Esempio n. 7
0
        /// <summary>
        /// On activated callback. It is used in order to continue the application
        /// after the user authenticated.
        /// </summary>
        protected override void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);
            var continuationManager   = new ContinuationManager();
            var continuationEventArgs = e as IContinuationActivatedEventArgs;

            if (continuationEventArgs != null)
            {
                continuationManager.Continue(continuationEventArgs);
            }
            Window.Current.Activate();
        }
Esempio n. 8
0
        protected override void OnActivated(IActivatedEventArgs args)
        {
            continuationManager = new ContinuationManager();

            // Activated again due to continuation?
            var contEventArgs = args as IContinuationActivatedEventArgs;

            if (contEventArgs != null)
            {
                continuationManager.Continue(contEventArgs);
            }

            base.OnActivated(args);
        }
Esempio n. 9
0
        /// <summary>
        /// Handle OnActivated event to deal with File Open/Save continuation activation kinds
        /// </summary>
        /// <param name="e">Application activated event arguments, it can be casted to proper sub-type based on ActivationKind</param>
        protected async override void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);
            continuationManager = new ContinuationManager();
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }
            if (e.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
                }
            }

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(MainPage));
            }

            var continuationEventArgs = e as IContinuationActivatedEventArgs;

            if (continuationEventArgs != null)
            {
                continuationManager.Continue(continuationEventArgs);
            }

            Window.Current.Activate();
        }
Esempio n. 10
0
        protected override async void OnActivated(IActivatedEventArgs args)
        {
            base.OnActivated(args);

            var rootFrame = await this.CreateRootFrameAsync(args.PreviousExecutionState);

            var continuationEventArgs = args as IContinuationActivatedEventArgs;

            if (continuationEventArgs != null)
            {
                // Call ContinuationManager to handle continuation activation.
                continuationManager = new ContinuationManager();
                continuationManager.Continue(continuationEventArgs);
            }

            Window.Current.Activate();
        }
Esempio n. 11
0
        protected override void OnActivated(IActivatedEventArgs args)
        {
            base.OnActivated(args);

            var rootFrame           = _frame;
            var continuationManager = new ContinuationManager();

            var continuationEventArgs = args as IContinuationActivatedEventArgs;

            if (continuationEventArgs != null)
            {
                if (rootFrame != null)
                {
                    continuationManager.Continue(continuationEventArgs, rootFrame);
                }
            }
        }
Esempio n. 12
0
        /// <summary>
        // Handle protocol activations and continuation activations.
        /// </summary>
        protected override void OnActivated(IActivatedEventArgs e)
        {
            if (e.Kind == ActivationKind.Protocol)
            {
                ProtocolActivatedEventArgs protocolArgs = e as ProtocolActivatedEventArgs;
                Frame rootFrame = CreateRootFrame();
                RestoreStatus(e.PreviousExecutionState);

                if (rootFrame.Content == null)
                {
                    if (!rootFrame.Navigate(typeof(MainPage)))
                    {
                        throw new Exception("Failed to create initial page");
                    }
                }

                var p = rootFrame.Content as MainPage;
                p.FileEvent     = null;
                p.ProtocolEvent = protocolArgs;
                p.NavigateToProtocolPage();

                // Ensure the current window is active
                Window.Current.Activate();
            }
#if WINDOWS_PHONE_APP
            else if (e.Kind == ActivationKind.PickFileContinuation)
            {
                base.OnActivated(e);

                var continuationEventArgs = e as IContinuationActivatedEventArgs;
                if (continuationEventArgs != null)
                {
                    CreateRootFrame();
                    RestoreStatus(e.PreviousExecutionState);

                    Frame scenarioFrame = MainPage.Current.FindName("ScenarioFrame") as Frame;
                    if (scenarioFrame != null)
                    {
                        continuationManager = new ContinuationManager();
                        continuationManager.Continue(continuationEventArgs, scenarioFrame);
                    }
                }
            }
#endif
        }
Esempio n. 13
0
        protected override void OnActivated(IActivatedEventArgs args)
        {
            // ContinuationManager tells app how to respond from Web Authentication.
            ContinuationManager = new ContinuationManager();

            var continuationEventArgs = args as IContinuationActivatedEventArgs;

            if (continuationEventArgs != null)
            {
                Frame scenarioFrame = Window.Current.Content as Frame;
                if (scenarioFrame != null)
                {
                    ContinuationManager.Continue(continuationEventArgs, scenarioFrame);
                }
            }

            base.OnActivated(args);
        }
Esempio n. 14
0
        protected async override void OnActivated(IActivatedEventArgs args)
        {
            base.OnActivated(args);

            ContinuationManager = new ContinuationManager();

            Frame rootFrame = CreateRootFrame();

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(MainPage));
            }

            var continuationEventArgs = args as IContinuationActivatedEventArgs;

            ContinuationManager.Continue(continuationEventArgs, rootFrame);

            Window.Current.Activate();
        }
Esempio n. 15
0
        protected override async void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);
            await RestoreStatusAsync(e.PreviousExecutionState);

            ApplicationView.GetForCurrentView().SetDesiredBoundsMode(ApplicationViewBoundsMode.UseVisible);

            if (e is IContinuationActivatedEventArgs)
            {
                ContinuationManager = new ContinuationManager();
                ContinuationManager.Continue(e as IContinuationActivatedEventArgs, RootFrame);
            }
            else if (e.Kind == ActivationKind.ToastNotification)
            {
                RootFrame.Navigate(typeof(MainPage), (e as IToastNotificationActivatedEventArgs).Argument);
            }

            Window.Current.Activate();
        }
Esempio n. 16
0
        /// <summary>
        ///     Handle OnActivated event to deal with File Open/Save continuation activation kinds
        /// </summary>
        /// <param name="e">Application activated event arguments, it can be casted to proper sub-type based on ActivationKind</param>
        protected override async void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);
            _continuationManager = new ContinuationManager();

            var rootFrame = CreateRootFrame();

            await RestoreStatusAsync(e.PreviousExecutionState).ConfigureAwait(true);

            SetRootFrameContent(rootFrame);

            var continuationEventArgs = e as IContinuationActivatedEventArgs;

            if (continuationEventArgs != null)
            {
                _continuationManager.Continue(continuationEventArgs);
            }

            Window.Current.Activate();
        }
Esempio n. 17
0
        /// <summary>
        /// Handle OnActivated event to deal with File Open/Save continuation activation kinds
        /// </summary>
        /// <param name="e">Application activated event arguments, it can be casted to proper sub-type based on ActivationKind</param>
        protected async override void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);

            continuationManager = new ContinuationManager();

            Frame rootFrame = await CreateRootFrameAndRestore(e.PreviousExecutionState);

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(PivotPage));
            }

            var continuationEventArgs = e as IContinuationActivatedEventArgs;

            if (continuationEventArgs != null)
            {
                continuationManager.Continue(continuationEventArgs, PivotPage.Current.Frame);
            }
        }
        protected async override void OnActivated(IActivatedEventArgs args)
        {
            ContinuationManager = new ContinuationManager();
            Frame rootFrame = CreateRootFrame();
            await RestoreStatusAsync(args.PreviousExecutionState);

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(MainPage));
            }

            var continuationEventArgs = args as IContinuationActivatedEventArgs;
            if (continuationEventArgs != null)
            {
                // Call ContinuationManager to handle continuation activation
                ContinuationManager.Continue(continuationEventArgs, rootFrame);
            }

            Window.Current.Activate();
        }
Esempio n. 19
0
        protected override void OnActivated(IActivatedEventArgs args)
        {
            base.OnActivated(args);

            continuationManager = new ContinuationManager();

            var continuationEventArgs = args as IContinuationActivatedEventArgs;

            if (continuationEventArgs == null)
            {
                return;
            }

            var frame = Window.Current.Content as Frame;

            if (frame != null)
            {
                // Call ContinuationManager to handle continuation activation
                continuationManager.Continue(continuationEventArgs, frame);
            }
        }
Esempio n. 20
0
        /// <summary>
        /// Called when the application is restored on the phone from e.g. a file picker dialog
        /// </summary>
        protected async override void OnActivated(IActivatedEventArgs args)
        {
            base.OnActivated(args);
            ContinuationManager = new ContinuationManager();

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

            // Get the event args for the continuation, and run them through the continuationmanager to feed the right information into the page that paused for it
            IContinuationActivatedEventArgs eventArgs = (IContinuationActivatedEventArgs)args;

            if (eventArgs != null)
            {
                ContinuationManager.Continue(eventArgs, (Frame)Window.Current.Content);
            }
            // Load the app into the front of the phone
            Window.Current.Activate();
        }
Esempio n. 21
0
        protected async override void OnActivated(IActivatedEventArgs args)
        {
            ContinuationManager = new ContinuationManager();
            Frame rootFrame = CreateRootFrame();

            await RestoreStatusAsync(args.PreviousExecutionState);

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(MainPage));
            }

            var continuationEventArgs = args as IContinuationActivatedEventArgs;

            if (continuationEventArgs != null)
            {
                // Call ContinuationManager to handle continuation activation
                ContinuationManager.Continue(continuationEventArgs, rootFrame);
            }

            Window.Current.Activate();
        }
Esempio n. 22
0
        /// <summary>
        /// Handle OnActivated event to deal with File Open/Save continuation activation kinds
        /// </summary>
        /// <param name="e">Application activated event arguments, it can be casted to proper sub-type based on ActivationKind</param>
        protected async override void OnActivated(IActivatedEventArgs e)
        {
            if (e.Kind.Equals(ActivationKind.PickFileContinuation))
            {
                base.OnActivated(e);

                ContinuationManager = new ContinuationManager();

                Frame rootFrame = CreateRootFrame();
                await RestoreStatusAsync(e.PreviousExecutionState);

                if (rootFrame.Content == null)
                {
                    rootFrame.Navigate(typeof(OptionsPage));
                }

                var continuationEventArgs = e as IContinuationActivatedEventArgs;

                if (continuationEventArgs != null)
                {
                    Frame scenarioFrame = OptionsPage.Current.FindName("ScenarioFrame") as Frame;

                    if (scenarioFrame != null)
                    {
                        // Call ContinuationManager to handle continuation activation
                        // pass the frame that it is the options page
                        ContinuationManager.Continue(continuationEventArgs, scenarioFrame);
                    }
                }

                Window.Current.Activate();
            }
            else
            {
            }
        }
Esempio n. 23
0
        /// <summary>
        /// Handle OnActivated event to deal with File Open/Save continuation activation kinds
        /// </summary>
        /// <param name="e">Application activated event arguments, it can be casted to proper sub-type based on ActivationKind</param>
        protected async override void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);

            continuationManager = new ContinuationManager();

            Frame rootFrame = CreateRootFrame();

            await RestoreStatusAsync(e.PreviousExecutionState);

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(MainPage));
            }

            var continuationEventArgs = e as IContinuationActivatedEventArgs;

            if (continuationEventArgs != null)
            {
                continuationManager.Continue(continuationEventArgs);
            }

            Window.Current.Activate();
        }
Esempio n. 24
0
        /// <summary>
        /// Handle OnActivated event to deal with File Open/Save continuation activation kinds
        /// </summary>
        /// <param name="e">Application activated event arguments, it can be casted to proper sub-type based on ActivationKind</param>
        protected async override void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);

            continuationManager = new ContinuationManager();

            Frame rootFrame = CreateRootFrame();
            await RestoreStatusAsync(e.PreviousExecutionState);

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(LoginPage));
            }

            var continuationEventArgs = e as IContinuationActivatedEventArgs;
            if (continuationEventArgs != null)
            {
                continuationManager.Continue(continuationEventArgs);
            }

            Window.Current.Activate();
        }
Esempio n. 25
0
        /// <summary>
        /// Handle OnActivated event to deal with File Open/Save continuation activation kinds
        /// </summary>
        /// <param name="e">Application activated event arguments, it can be casted to proper sub-type based on ActivationKind</param>
        protected async override void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);

            continuationManager = new ContinuationManager();

            Frame rootFrame = await CreateRootFrameAndRestore(e.PreviousExecutionState);

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(PivotPage));
            }

            var continuationEventArgs = e as IContinuationActivatedEventArgs;
            if (continuationEventArgs != null)
            {
                continuationManager.Continue(continuationEventArgs, PivotPage.Current.Frame);
            }
        }
Esempio n. 26
0
        protected override void OnActivated(IActivatedEventArgs args)
        {
            // ContinuationManager tells app how to respond from Web Authentication.
            ContinuationManager = new ContinuationManager();

            var continuationEventArgs = args as IContinuationActivatedEventArgs;
            if (continuationEventArgs != null)
            {
                Frame scenarioFrame = Window.Current.Content as Frame;
                if (scenarioFrame != null)
                {
                    ContinuationManager.Continue(continuationEventArgs, scenarioFrame);
                }
            }

            base.OnActivated(args);
        }
Esempio n. 27
0
        /// <summary>
        // Handle protocol activations and continuation activations.
        /// </summary>
        protected override void OnActivated(IActivatedEventArgs e)
        {
            if (e.Kind == ActivationKind.Protocol)
            {
                ProtocolActivatedEventArgs protocolArgs = e as ProtocolActivatedEventArgs;
                Frame rootFrame = CreateRootFrame();
                RestoreStatus(e.PreviousExecutionState);

                if (rootFrame.Content == null)
                {
                    if (!rootFrame.Navigate(typeof(MainPage)))
                    {
                        throw new Exception("Failed to create initial page");
                    }
                }

                var p = rootFrame.Content as MainPage;
                p.FileEvent = null;
                p.ProtocolEvent = protocolArgs;
                p.NavigateToProtocolPage();

                // Ensure the current window is active
                Window.Current.Activate();
            }
#if WINDOWS_PHONE_APP
            else if (e.Kind == ActivationKind.PickFileContinuation)
            {
                base.OnActivated(e);

                var continuationEventArgs = e as IContinuationActivatedEventArgs;
                if (continuationEventArgs != null)
                {
                    CreateRootFrame();
                    RestoreStatus(e.PreviousExecutionState);

                    Frame scenarioFrame = MainPage.Current.FindName("ScenarioFrame") as Frame;
                    if (scenarioFrame != null)
                    {
                        continuationManager = new ContinuationManager();
                        continuationManager.Continue(continuationEventArgs, scenarioFrame);
                    }
                }
            }
#endif
        }
Esempio n. 28
0
        protected override void OnActivated(IActivatedEventArgs args)
        {
            base.OnActivated(args);

            continuationManager = new ContinuationManager();

            var continuationEventArgs = args as IContinuationActivatedEventArgs;
            if (continuationEventArgs == null)
                return;

            var frame = Window.Current.Content as Frame;
            if (frame != null)
            {
                // Call ContinuationManager to handle continuation activation
                continuationManager.Continue(continuationEventArgs, frame);
            }
        }
Esempio n. 29
0
        /// <summary>
        /// Handle OnActivated event to deal with File Open/Save continuation activation kinds
        /// </summary>
        /// <param name="e">Application activated event arguments, it can be casted to proper sub-type based on ActivationKind</param>
        protected async override void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);

            continuationManager = new ContinuationManager();

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();

                // Do not repeat app initialization when the Window already has content,
                // just ensure that the window is active
                if (e.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
                    }
                }

                // Place the frame in the current Window
                Window.Current.Content = rootFrame;
            }

            if (rootFrame.Content == null)
            {
                if (!rootFrame.Navigate(typeof(UrlToolkit.View.MainView)))
                {
                    throw new Exception("Failed to create initial page");
                }
            }

            var continuationEventArgs = e as IContinuationActivatedEventArgs;
            if (continuationEventArgs != null)
            {
                // TODO: Normalde burada register edilmiş frame'i alıp onu continue fonksiyonuna gönderiyor.
                // Call ContinuationManager to handle continuation activation
                continuationManager.Continue(continuationEventArgs);
            }

            Window.Current.Activate();
        }
Esempio n. 30
0
        /// <summary>
        /// Handle OnActivated event to deal with File Open/Save continuation activation kinds
        /// </summary>
        /// <param name="e">Application activated event arguments, it can be casted to proper sub-type based on ActivationKind</param>
        protected override async void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);

            continuationManager = new ContinuationManager();

            Frame rootFrame = CreateRootFrame();

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(MainPage));
            }

            var continuationEventArgs = e as IContinuationActivatedEventArgs;
            if (continuationEventArgs != null)
            {
                Frame scenarioFrame = Window.Current.Content as Frame;
                if (scenarioFrame != null)
                {
                    // Call ContinuationManager to handle continuation activation
                    continuationManager.Continue(continuationEventArgs, scenarioFrame);
                }
            }

            Window.Current.Activate();
        }
Esempio n. 31
0
        protected override async void OnActivated(IActivatedEventArgs args)
        {            
            base.OnActivated(args);
#if WINDOWS_PHONE_APP            
            Frame rootFrame = Window.Current.Content as Frame;
            if (rootFrame == null)
            {
                rootFrame = new Frame();
                Window.Current.Content = rootFrame;
            }

            if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
            {
                //await SuspensionManager.RestoreAsync(); //disabling this until we can find a way to not trap users on the SettingsPage.
            }

            var continuationEventArgs = args as IContinuationActivatedEventArgs;
            if (continuationEventArgs != null)
            {                
                if(rootFrame.CurrentSourcePageType != typeof(MainPage))
                {
                    rootFrame.Navigate(typeof(MainPage));
                }
                ContinuationManager manager = new ContinuationManager();
                manager.Continue(continuationEventArgs, rootFrame);
            }
#endif            
        }
Esempio n. 32
0
        protected async override void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);

            continuationManager = new ContinuationManager();

            Frame rootFrame = CreateRootFrame();
            await RestoreStatusAsync(e.PreviousExecutionState);

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(IndexPivotPage));
            }

            var continuationEventArgs = e as IContinuationActivatedEventArgs;
            FileOpenPickerContinuationEventArgs arguments = continuationEventArgs as FileOpenPickerContinuationEventArgs;

            if (continuationEventArgs != null)
            {
                switch (continuationEventArgs.Kind)
                {
                    case ActivationKind.PickFileContinuation:

                        //string passedData = (string)arguments.ContinuationData["keyParameter"];
                        StorageFile pickedFile = arguments.Files.FirstOrDefault();

                        CardSet pickedCardSet = await new DataLoader().LoadFrom_StorageFile(pickedFile);

                        userSetManager.AddNewCardSet(pickedCardSet);

                        appWideUserSet = userSetManager.UserSet as UserSet;

                        break;
                }
            }
                        //var continuationEventArgs = e as IContinuationActivatedEventArgs;
             

            if (continuationEventArgs != null)
            {
                
                // Call ContinuationManager to handle continuation activation
                continuationManager.Continue(continuationEventArgs);
            }

            Window.Current.Activate();
        }
Esempio n. 33
0
        /// <summary>
        /// Handle OnActivated event to deal with File Open/Save continuation activation kinds
        /// </summary>
        /// <param name="e">Application activated event arguments, it can be casted to proper sub-type based on ActivationKind</param>
        protected async override void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);
            Debug.WriteLine("First line");
            continuationManager = new ContinuationManager();

            Frame rootFrame = CreateRootFrame();
            await RestoreStatusAsync(e.PreviousExecutionState);
            Debug.WriteLine("Second line");

            if(rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(MainPage));
            }

            var continuationEventArgs = e as IContinuationActivatedEventArgs;
            if (continuationEventArgs != null)
            {
                Frame appFrame = Window.Current.Content as Frame;
                if (appFrame != null)
                {
                    // Call ContinuationManager to handle continuation activation
                    continuationManager.Continue(continuationEventArgs, appFrame);
                }
            }
            Debug.WriteLine("Third line");

            Window.Current.Activate();
        }
        protected async override void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);

            continuationManager = new ContinuationManager();

            Frame rootFrame = CreateRootFrame();
            await RestoreStatusAsync(e.PreviousExecutionState);

            if (rootFrame.Content == null)
            {
                rootFrame.Navigate(typeof(MainPage));
            }

            var continuationEventArgs = e as IContinuationActivatedEventArgs;
            if (continuationEventArgs != null)
            {
                Frame scenarioFrame = MainPage.Current.FindName("ContentFrame") as Frame;
                if (scenarioFrame != null)
                {
                    // Call ContinuationManager to handle continuation activation
                    continuationManager.Continue(continuationEventArgs, scenarioFrame);
                }
            }

            Window.Current.Activate();
        }
Esempio n. 35
0
        /// <summary>
        /// Handle OnActivated event to deal with File Open/Save continuation activation kinds
        /// </summary>
        /// <param name="e">Application activated event arguments, it can be casted to proper sub-type based on ActivationKind</param>
        protected async override void OnActivated(IActivatedEventArgs e)
        {            
            if (e.Kind.Equals(ActivationKind.PickFileContinuation))
            {
               
                base.OnActivated(e);

                ContinuationManager = new ContinuationManager();

                Frame rootFrame = CreateRootFrame();
                await RestoreStatusAsync(e.PreviousExecutionState);

                if (rootFrame.Content == null)
                {

                    rootFrame.Navigate(typeof(OptionsPage));
                }

                var continuationEventArgs = e as IContinuationActivatedEventArgs;

                if (continuationEventArgs != null)
                {
                    Frame scenarioFrame = OptionsPage.Current.FindName("ScenarioFrame") as Frame;

                    if (scenarioFrame != null)
                    {
                        // Call ContinuationManager to handle continuation activation
                        // pass the frame that it is the options page
                        ContinuationManager.Continue(continuationEventArgs, scenarioFrame);
                    }

                }
                
                Window.Current.Activate();

            }
            else {
                
            }
           
        }