public void GetWeatherForcast(Action<List<WeatherModel>> callback, String location, String country) { ViewCallback = callback; WeatherRepository weatherRep = new WeatherRepository(); GetWeatherForcastCallback handler = new GetWeatherForcastCallback(GetWeatherForcastCompleted); weatherRep.GetWeatherForcast(new Action<List<WeatherModel>>(handler), location, country); }
private void loadWeatherBtn_Click(object sender, RoutedEventArgs e) { String location = locationTxt.Text; String country = countryTxt.Text; WeatherModel weatherModel = new WeatherModel(); GetWeatherForcastCallback handler = new GetWeatherForcastCallback(GetWeatherForcastCompleted); weatherModel.GetWeatherForcast(new Action<List<WeatherModel>>(handler), location, country); }