Exemplo n.º 1
0
        private void searchButton_Click(object sender, RoutedEventArgs e)
        {
            OpenWeatherServices openWeatherServices = new OpenWeatherServices();
            WeatherInfo         info = openWeatherServices.GetWeatherFor(searchTextBox.Text);

            temperatureLabel.Content = info.Main.temp + " °C";
            mainWindow.Icon          = new BitmapImage(new Uri($"http://openweathermap.org/img/wn/{info.weather[0].icon}@2x.png"));
        }