示例#1
0
        protected override void OnActivated(IActivatedEventArgs e)
        {
            base.OnActivated(e);

            if (e.Kind == ActivationKind.VoiceCommand)
            {
                var commandArgs = e as VoiceCommandActivatedEventArgs;

                Scenario scenario = VoiceService.GetScenarioFromInput(commandArgs);

                Frame rootFrame = Window.Current.Content as Frame;
                if (rootFrame != null)
                {
                    if (scenario != null)
                    {
                        rootFrame.Navigate(typeof(ActionPage), scenario);
                    }
                    else
                    {
                        rootFrame.Navigate(typeof(MainPage));
                    }
                }
            }
        }