示例#1
0
        private async void _WeatherTimer_Tick(object sender, object e)
        {
            Proxy.RootObject2 weatherDesc = await Proxy.GetWeatherDesciption();

            Proxy.RootObject myweather = await Proxy.GetWeather();

            WeatherDescription.Text = weatherDesc.current_observation.weather;
            ResultTextBlock.Text    = (Int32)myweather.current_condition.tmp + "°";
        }
示例#2
0
        private async void WeatherDescription_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                TextBlockTitle2.Text = "Executive Briefing Center";
                //calling the web service for weather
                Proxy.RootObject2 weatherDesc = await Proxy.GetWeatherDesciption();

                Proxy.RootObject myweather = await Proxy.GetWeather();

                WeatherDescription.Text = weatherDesc.current_observation.weather;
                ResultTextBlock.Text    = (Int32)myweather.current_condition.tmp + "°";
                _welcomeTimer           = new DispatcherTimer()
                {
                    Interval = TimeSpan.FromMinutes(13)
                };

                _welcomeTimer.Tick += _WeatherTimer_Tick;
                _welcomeTimer.Start();

                var year  = DateTime.Now.ToString("yyyy");
                var day   = DateTime.Now.ToString("dd");
                var month = DateTime.Now.ToString("MMMM", CultureInfo.InvariantCulture);
                TextDate.Text = DateTime.Now.DayOfWeek.ToString() + ", " + month + " " + day + ", " + year;
                //string icon = string.Format("{0}", myweather.current_condition.icon);
                // ResultImage.Source = new BitmapImage(new Uri(icon, UriKind.Absolute));

                ///calling the service for the guest

                //string name = string.Format("hey",myvalue.BriefingTitle);
            }
            catch (Exception)
            {
                WeatherDescription.Text = " no weather ";
            }
        }