Exemplo n.º 1
0
        /// <summary>
        /// 使用在导航过程中传递的内容填充页。  在从以前的会话
        /// 重新创建页时,也会提供任何已保存状态。
        /// </summary>
        /// <param name="sender">
        /// 事件的来源; 通常为 <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e">事件数据,其中既提供在最初请求此页时传递给
        /// <see cref="Frame.Navigate(Type, Object)"/> 的导航参数,又提供
        /// 此页在以前会话期间保留的状态的
        /// 字典。 首次访问页面时,该状态将为 null。</param>
        private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            if (e.NavigationParameter == null)
            {
                return;
            }

            if (e.NavigationParameter.GetType().Equals(typeof(string)))
            {
                string CS = e.NavigationParameter.ToString();
                this.DefaultViewModel["CS"] = CS;

                //处理浏览器
                _htmltianqiV.Source = new Uri("http://waptianqi.2345.com");
            }
            if (e.NavigationParameter.GetType().Equals(typeof(VoiceCommandActivatedEventArgs)))
            {
                VoiceCommandActivatedEventArgs commandArgs_thisone     = e.NavigationParameter as VoiceCommandActivatedEventArgs;
                SpeechRecognitionResult        speechRecognitionResult = commandArgs_thisone.Result;

                string voiceCommandName = speechRecognitionResult.RulePath[0];
                string textSpoken       = speechRecognitionResult.Text;
                string navigationTarget = speechRecognitionResult.SemanticInterpretation.Properties["NavigationTarget"][0];
                //await new MessageDialog(textSpoken.Replace("的天气", "").Replace("天气", "").Trim()).ShowAsync();

                PublicS.GetInitCityDM();
                string cityDM = "http://waptianqi.2345.com";
                PublicS.CityDicDM.TryGetValue(textSpoken.Replace("预报", "").Replace("的天气", "").Replace("天气", "").Trim(), out cityDM);
                PublicS.CityDicDM.Clear();
                _htmltianqiV.Source = new Uri(cityDM);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 使用在导航过程中传递的内容填充页。  在从以前的会话
        /// 重新创建页时,也会提供任何已保存状态。
        /// </summary>
        /// <param name="sender">
        /// 事件的来源; 通常为 <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e">事件数据,其中既提供在最初请求此页时传递给
        /// <see cref="Frame.Navigate(Type, Object)"/> 的导航参数,又提供
        /// 此页在以前会话期间保留的状态的
        /// 字典。 首次访问页面时,该状态将为 null。</param>
        private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            if (e.NavigationParameter == null)
            {
                return;
            }

            if (e.NavigationParameter.GetType().Equals(typeof(string)))
            {
                string CS = e.NavigationParameter.ToString();
                this.DefaultViewModel["CS"] = CS;

                //处理浏览器
                _htmltianqiV.Source = new Uri("http://m.8684.cn/bus");
            }
            if (e.NavigationParameter.GetType().Equals(typeof(VoiceCommandActivatedEventArgs)))
            {
                VoiceCommandActivatedEventArgs commandArgs_thisone     = e.NavigationParameter as VoiceCommandActivatedEventArgs;
                SpeechRecognitionResult        speechRecognitionResult = commandArgs_thisone.Result;

                string voiceCommandName = speechRecognitionResult.RulePath[0];
                string textSpoken       = speechRecognitionResult.Text;
                string navigationTarget = speechRecognitionResult.SemanticInterpretation.Properties["NavigationTarget"][0];


                PublicS.GetInitGongJiao();
                string gongjiao = "";
                PublicS.GongJiaoDic.TryGetValue(textSpoken.Replace("公交", "").Replace("信息", "").Replace("线路", "").Replace("路线", "").Trim(), out gongjiao);
                PublicS.GongJiaoDic.Clear();
                _htmltianqiV.Source = new Uri(gongjiao);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 使用在导航过程中传递的内容填充页。  在从以前的会话
        /// 重新创建页时,也会提供任何已保存状态。
        /// </summary>
        /// <param name="sender">
        /// 事件的来源; 通常为 <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e">事件数据,其中既提供在最初请求此页时传递给
        /// <see cref="Frame.Navigate(Type, Object)"/> 的导航参数,又提供
        /// 此页在以前会话期间保留的状态的
        /// 字典。 首次访问页面时,该状态将为 null。</param>
        private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            if (e.NavigationParameter == null)
            {
                return;
            }

            if (e.NavigationParameter.GetType().Equals(typeof(string)))
            {
                string CS = e.NavigationParameter.ToString();
                this.DefaultViewModel["CS"] = CS;

                //处理浏览器
                _htmltianqiV.Source = new Uri("http://tools.2345.com/m/naonao/");
            }
            if (e.NavigationParameter.GetType().Equals(typeof(VoiceCommandActivatedEventArgs)))
            {
                VoiceCommandActivatedEventArgs commandArgs_thisone     = e.NavigationParameter as VoiceCommandActivatedEventArgs;
                SpeechRecognitionResult        speechRecognitionResult = commandArgs_thisone.Result;

                string voiceCommandName = speechRecognitionResult.RulePath[0];
                string textSpoken       = speechRecognitionResult.Text;
                string navigationTarget = speechRecognitionResult.SemanticInterpretation.Properties["NavigationTarget"][0];
                //await new MessageDialog(textSpoken.Replace("的天气", "").Replace("天气", "").Trim()).ShowAsync();

                PublicS.XingZuoDic_y.Clear();
                PublicS.XingZuoDic_z.Clear();
                PublicS.GetInitXingZuo();
                if (textSpoken.IndexOf("本月") >= 0)
                {
                    _htmltianqiV.Source = new Uri(PublicS.XingZuoDic_y[PublicS.GetXZ(textSpoken)]);
                }
                else
                {
                    _htmltianqiV.Source = new Uri(PublicS.XingZuoDic_z[PublicS.GetXZ(textSpoken)]);
                }
                PublicS.XingZuoDic_y.Clear();
                PublicS.XingZuoDic_z.Clear();
            }
        }