Example #1
0
        private void DisplayWeather(GenericWeather weather)
        {
            CurrentTemperature = $"{((Settings.IsFahrenheit) ? Math.Round(weather.CurrentObservation.Temperature) : Math.Round(WeatherHelper.GetCelsius(weather.CurrentObservation.Temperature)))}{TempUnit}";

            if (!Settings.IsFahrenheit)
            {
                foreach (var day in weather.Forecast.Days)
                {
                    day.TemperatureHigh = Math.Round(WeatherHelper.GetCelsius(day.TemperatureHigh));
                    day.TemperatureLow  = Math.Round(WeatherHelper.GetCelsius(day.TemperatureLow));
                }
            }

            ForecastCollection = weather.Forecast.Days;

            AttributionText = weather.Source;
        }