Example #1
0
        private async void Button_click(object sender, RoutedEventArgs e)
        {
            var position = await LocationManager.GetPosition();

            //53.2707° N, 9.0568° W galway
            RootObject myWeather = await OpenWeatherMapProxy.GetWeather(position.Coordinate.Latitude, position.Coordinate.Longitude);



            //String icon = String.Format("ms-appx:///Assets/WeatherIcons/{0}.png", myWeather.weather[0].icon); //access local resource with uri
            //ResultImage.Source = new BitmapImage(new Uri(icon, UriKind.Absolute));

            ResultTextBlock.Text = "Current location : " + myWeather.name + " \n" +
                                   "Current Temperture : " + ((int)myWeather.main.temp).ToString() + "°C" + " \n" +
                                   "Humidity : " + myWeather.main.humidity + "%" + "\n" +
                                   "Description : " + myWeather.weather[0].description;


            ResultTextBlock2.Text = "Current Coordinates :" + "\n" + "Latitude : " + position.Coordinate.Latitude + "\n" + "Longitude : " + position.Coordinate.Longitude;
        }