private void Search() { string city = cityTextBox.Text; WeatherAPIService weatherAPI = new WeatherAPIService(city); if (weatherAPI.xmlDocument == null) { MessageBox.Show("Введен неверный город"); return; } WeatherData weather = new WeatherData(city); List <DayTemperature> dayTemperatures = weather.GetWeather(); listBox.ItemsSource = dayTemperatures; }
private void searchButtonClick(object sender, RoutedEventArgs e) { string city = cityTextBox.Text; WeatherAPIService weatherAPI = new WeatherAPIService(city); if (weatherAPI.xmlDocument == null) { MessageBox.Show("Введен неверный город"); return; } WeatherData weather = new WeatherData(city); List <TimeTemperature> timeTemperatures = weather.GetWeather(); dataGrid.ItemsSource = timeTemperatures; }
public List <TimeTemperature> GetWeather() { WeatherAPIService dataAPI = new WeatherAPIService(City); return(dataAPI.GetTemp()); }