Пример #1
0
        /// <summary>
        /// Receive a voice recognition result and handle logic based on command.
        /// </summary>
        public void ProcessVoiceCommand(SpeechRecognitionResult command)
        {
            IReadOnlyDictionary <string, IReadOnlyList <string> > tags = command.SemanticInterpretation.Properties;
            string cmd       = tags.ContainsKey(WeatherCommands.TAG_CMD) ? tags[WeatherCommands.TAG_CMD][0] : "";
            string timeFrame = tags.ContainsKey(WeatherCommands.TAG_TIME) ? tags[WeatherCommands.TAG_TIME][0] : "";
            //TODO this should be passed in somewhere as a singleton or injected.
            WeatherModel weatherModel = new WeatherModel();
            string       city         = "";

            weatherModel.HandleVoiceCommand(cmd, timeFrame, city);
        }
Пример #2
0
 public WeatherViewModel(WeatherModel model)
 {
     weatherModel = model;
 }