Beispiel #1
0
        // Load data for the ViewModel Items
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {

            promptForLocation();
            if (!App.ViewModel.IsDataLoaded)
            {
                App.ViewModel.LoadData();
            }
            // Is this a new activation or a resurrection from tombstone?
            if (e.NavigationMode == System.Windows.Navigation.NavigationMode.New)
            {
                
                InitializeComponent();

                SystemTray.SetIsVisible(this, true);

                SystemTray.SetOpacity(this, 1);
                SystemTray.SetBackgroundColor(this, Colors.Orange);
                SystemTray.SetForegroundColor(this, Colors.Black);

                progressIndicator = new ProgressIndicator();
                progressIndicator.IsVisible = true;
                progressIndicator.IsIndeterminate = true;

                // Was the app launched using a voice command?
                if (NavigationContext.QueryString.ContainsKey("voiceCommandName"))
                {

                    progressIndicator.Text = "Responding...";
                    SystemTray.SetProgressIndicator(this, progressIndicator);


                    engin = new RecognitionEngin();
                    engin.RespondToQuery(NavigationContext.QueryString, FinishResponseSimple, SentViewableResult);
                }
                else
                    StopButton.Visibility = Visibility.Collapsed;
            }
        }
Beispiel #2
0
        public void FakeCommand(object sender, EventArgs eventArgs)
        {
            Dictionary<String,String > dic= new Dictionary<string, string>();
            dic.Add("voiceCommandName", "currentLocalWeather");

            RecognitionEngin engin = new RecognitionEngin();
            engin.RespondToQuery(dic, FinishResponseSimple, SentViewableResult);
        }