/// <summary>
        /// по нажатию на кнопку пытаемся обновиться данными с сервера
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btUpdateClick(object sender, RoutedEventArgs e)
        {
            aq.AddAnimation(0);
            try
            {
                wc.DownloadStringAsync(new Uri("http://api.openweathermap.org/data/2.5/forecast/daily?q=Moscow&mode=xml&units=metric&cnt=7", UriKind.Absolute));
            }
            catch
            {
                Debug.WriteLine("download error");

                tbError.Visibility = Visibility.Visible;
                UpdateUI();
            }
        }
Example #2
0
 public void AddFramingAnimation(double duration, int frame = 0, double latency = 0, bool permanent = false)
 {
     framingAnimations.AddAnimation(new FramingAnimation(latency, duration, frame));
     if (permanent)
     {
         framingAnimations.MakeFirstAnimationPermanent();
     }
 }
Example #3
0
 public void AddRotatingAnimation(double angle, double duration, double latency = 0, bool permanent = false)
 {
     rotatingAnimations.AddAnimation(new RotatingAnimation(latency, duration, angle));
     if (permanent)
     {
         rotatingAnimations.MakeFirstAnimationPermanent();
     }
 }
Example #4
0
 public void AddMovingAnimation(double x, double y, double duration, double latency = 0, bool permanent = false)
 {
     movingAnimations.AddAnimation(new MovingAnimation(latency, duration,
                                                       new Point2(x, y)));
     if (permanent)
     {
         movingAnimations.MakeFirstAnimationPermanent();
     }
 }