From 8806bc0d7b9736b3a7446775daac1370577cbe95 Mon Sep 17 00:00:00 2001 From: Ken Wilcox Date: Fri, 29 Jun 2018 09:30:18 -0600 Subject: [PATCH] allow the user to set unit of measure. --- Samples/WeatherApp/Core.cs | 4 ++-- Samples/WeatherApp/WeatherPage.xaml | 4 +++- Samples/WeatherApp/WeatherPage.xaml.cs | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Samples/WeatherApp/Core.cs b/Samples/WeatherApp/Core.cs index 31ee5e9..1d61701 100644 --- a/Samples/WeatherApp/Core.cs +++ b/Samples/WeatherApp/Core.cs @@ -5,12 +5,12 @@ namespace WeatherApp { public class Core { - public static async Task GetWeather(string zipCode) + public static async Task GetWeather(string zipCode, string units = "kelvin") { //Sign up for a free API key at http://openweathermap.org/appid string key = "fc9f6c524fc093759cd28d41fda89a1b"; string queryString = "http://api.openweathermap.org/data/2.5/weather?zip=" - + zipCode + "&appid=" + key; + + zipCode + "&appid=" + key + "&units=" + units; var results = await DataService.getDataFromService(queryString).ConfigureAwait(false); diff --git a/Samples/WeatherApp/WeatherPage.xaml b/Samples/WeatherApp/WeatherPage.xaml index 29bc1e0..5de42b2 100644 --- a/Samples/WeatherApp/WeatherPage.xaml +++ b/Samples/WeatherApp/WeatherPage.xaml @@ -34,6 +34,8 @@ FontSize="Medium" />