using System.Threading.Tasks;
using WeatherInformation.Model.ForecastWeatherParser;
using WeatherInformation.Model.JsonDataParser;
+using WeatherInformation.Model.CurrentWeatherParser;
namespace WeatherInformation
{
{
// This method loads the data from isolated storage, if it is available.
string JSONRemoteForecastWeatherData = sr.ReadLine();
- // string remoteCurrentWeatherData = sr.ReadLine();
- var weatherData = WeatherParser(JSONRemoteForecastWeatherData, null);
+ string JSONRemoteCurrentWeatherData = sr.ReadLine();
+ var weatherData = WeatherParser(JSONRemoteForecastWeatherData, JSONRemoteCurrentWeatherData);
weatherData.JSONRemoteForecastWeatherData = JSONRemoteForecastWeatherData;
- weatherData.JSONRemoteCurrentWeatherData = null;
+ weatherData.JSONRemoteCurrentWeatherData = JSONRemoteCurrentWeatherData;
weatherData.WasThereRemoteError = false;
ApplicationDataObject = weatherData;
}
(double)IsolatedStorageSettings.ApplicationSettings["CurrentLongitude"], resultsNumber);
string JSONRemoteForecastWeatherData = await httpClient.GetWeatherDataAsync(formattedForecastURL);
- var weatherData = WeatherParser(JSONRemoteForecastWeatherData, null);
+ string formattedCurrentURL = String.Format(
+ CultureInfo.InvariantCulture, AppResources.URIAPIOpenWeatherMapCurrent,
+ AppResources.APIVersionOpenWeatherMap, (double)IsolatedStorageSettings.ApplicationSettings["CurrentLatitude"],
+ (double)IsolatedStorageSettings.ApplicationSettings["CurrentLongitude"], resultsNumber);
+ string JSONRemoteCurrentWeatherData = await httpClient.GetWeatherDataAsync(formattedCurrentURL);
+
+ var weatherData = WeatherParser(JSONRemoteForecastWeatherData, JSONRemoteCurrentWeatherData);
weatherData.WasThereRemoteError = false;
weatherData.JSONRemoteForecastWeatherData = JSONRemoteForecastWeatherData;
- weatherData.JSONRemoteCurrentWeatherData = null;
+ weatherData.JSONRemoteCurrentWeatherData = JSONRemoteCurrentWeatherData;
ApplicationDataObject = weatherData;
}
private WeatherData WeatherParser(string remoteForecastWeatherData, string remoteCurrentWeatherData)
{
- ForecastWeather weather = new ServiceParser(new JsonParser()).GetForecastWeather(remoteForecastWeatherData);
+ ServiceParser parser = new ServiceParser(new JsonParser());
+ ForecastWeather remoteForecastWeather = parser.GetForecastWeather(remoteForecastWeatherData);
+ CurrentWeather remoteCurrentWeather = parser.GetCurrentWeather(remoteCurrentWeatherData);
return new WeatherData
{
- RemoteForecastWeatherData = weather,
- RemoteCurrentWeatherData = null
+ RemoteForecastWeatherData = remoteForecastWeather,
+ RemoteCurrentWeatherData = remoteCurrentWeather
};
}
using (StreamWriter sw = new StreamWriter(fileStream))
{
sw.Write(value.JSONRemoteForecastWeatherData);
+ sw.Write(value.JSONRemoteCurrentWeatherData);
fileStream.Flush(true);
}
// determine the locale.
//if (Debugger.IsAttached && String.IsNullOrWhiteSpace(appForceCulture) == false)
//{
- // Thread.CurrentThread.CurrentCulture = new CultureInfo(appForceCulture);
- // Thread.CurrentThread.CurrentUICulture = new CultureInfo(appForceCulture);
+ Thread.CurrentThread.CurrentCulture = new CultureInfo(appForceCulture);
+ Thread.CurrentThread.CurrentUICulture = new CultureInfo(appForceCulture);
//}
// Establecer la fuente para que coincida con el idioma definido por
<!--Elemento Pivot dos-->
<phone:PivotItem Header="{Binding LocalizedResources.MainPageCurrentHeader, Mode=OneWay, Source={StaticResource LocalizedStrings}}">
<ScrollViewer HorizontalScrollBarVisibility="Auto">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="*" />
+ <RowDefinition Height="*" />
+ <RowDefinition Height="*" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+ <StackPanel Grid.Column="0" Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
+ <Image Source="/Assets/Tiles/IconicTileMediumLarge.png" Width="100" Height="100" Margin="12,-6,12,0" />
+ <StackPanel Orientation="Vertical" VerticalAlignment="Center">
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
+ <TextBlock Text="{Binding CurrentMaxTemp}" TextWrapping="Wrap" Style="{StaticResource PhoneTextLargeStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Margin="2,0"/>
+ <TextBlock Text="{Binding CurrentMaxTempUnits}" TextWrapping="Wrap" Style="{StaticResource PhoneTextLargeStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Margin="2,0"/>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
+ <TextBlock Text="{Binding CurrentMinTemp}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Margin="2,0"/>
+ <TextBlock Text="{Binding CurrentMinTempUnits}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Margin="2,0"/>
+ </StackPanel>
+ </StackPanel>
+ </StackPanel>
+ <StackPanel Grid.Column="0" Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
+ <TextBlock Text="{Binding CurrentConditions}" TextWrapping="Wrap" Style="{StaticResource PhoneTextLargeStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Margin="2,0"/>
+ </StackPanel>
+ <Grid Grid.Column="0" Grid.Row="2" HorizontalAlignment="Center">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+ <StackPanel Grid.Column="0" Grid.Row="0" Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Center">
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
+ <TextBlock Text="{Binding LocalizedResources.MainPageCurrentFeelsLike, Mode=OneWay, Source={StaticResource LocalizedStrings}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,0"/>
+ <TextBlock Text="{Binding CurrentFeelsLikeTemp}" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,2,0"/>
+ <TextBlock Text="{Binding CurrentFeelsLikeTempUnits}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Margin="2,0"/>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
+ <TextBlock Text="{Binding LocalizedResources.MainPageCurrentHumidity, Mode=OneWay, Source={StaticResource LocalizedStrings}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,0"/>
+ <TextBlock Text="{Binding CurrentHumidity}" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,2,0"/>
+ <TextBlock Text="{Binding CurrentHumidityUnits}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Margin="2,0"/>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
+ <TextBlock Text="{Binding LocalizedResources.MainPageCurrentRain, Mode=OneWay, Source={StaticResource LocalizedStrings}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,0"/>
+ <TextBlock Text="{Binding CurrentRain}" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,2,0"/>
+ <TextBlock Text="{Binding CurrentRainUnits}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Margin="2,0"/>
+ </StackPanel>
+ </StackPanel>
+ <StackPanel Grid.Column="1" Grid.Row="0" Orientation="Vertical" HorizontalAlignment="Right" VerticalAlignment="Center">
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
+ <TextBlock Text="{Binding LocalizedResources.MainPageCurrentSnow, Mode=OneWay, Source={StaticResource LocalizedStrings}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,0,12,0"/>
+ <TextBlock Text="{Binding CurrentSnow}" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,2,0"/>
+ <TextBlock Text="{Binding CurrentSnowUnits}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Margin="2,0"/>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
+ <TextBlock Text="{Binding LocalizedResources.MainPageCurrentWind, Mode=OneWay, Source={StaticResource LocalizedStrings}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,0"/>
+ <TextBlock Text="{Binding CurrentWind}" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,2,0"/>
+ <TextBlock Text="{Binding CurrentWindUnits}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Margin="2,0"/>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
+ <TextBlock Text="{Binding LocalizedResources.MainPageCurrentClouds, Mode=OneWay, Source={StaticResource LocalizedStrings}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,0"/>
+ <TextBlock Text="{Binding CurrentClouds}" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,2,0"/>
+ <TextBlock Text="{Binding CurrentSnowUnits}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Margin="2,0"/>
+ </StackPanel>
+ </StackPanel>
+ </Grid>
+ <StackPanel Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Center">
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="{Binding LocalizedResources.MainPageCurrentPressure, Mode=OneWay, Source={StaticResource LocalizedStrings}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,0"/>
+ <TextBlock Text="{Binding CurrentPressure}" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,2,0"/>
+ <TextBlock Text="{Binding CurrentPressureUnits}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Margin="2,0"/>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="{Binding LocalizedResources.MainPageCurrentSunRise, Mode=OneWay, Source={StaticResource LocalizedStrings}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,0"/>
+ <TextBlock Text="{Binding CurrentSunRise}" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,0"/>
+ </StackPanel>
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="{Binding LocalizedResources.MainPageCurrentSunSet, Mode=OneWay, Source={StaticResource LocalizedStrings}}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,0"/>
+ <TextBlock Text="{Binding CurrentSunSet}" TextWrapping="Wrap" Style="{StaticResource PhoneTextSubtleStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,0"/>
+ </StackPanel>
+ </StackPanel>
+ </Grid>
</ScrollViewer>
</phone:PivotItem>
</phone:Pivot>
public class Coord
{
public double lon { get; set; }
- public int lat { get; set; }
+ public double lat { get; set; }
}
}
public string @base { get; set; }
public Main main { get; set; }
public Wind wind { get; set; }
+ public Snow snow { get; set; }
public Rain rain { get; set; }
public Clouds clouds { get; set; }
public int dt { get; set; }
public class Main
{
public double temp { get; set; }
- public int pressure { get; set; }
+ public double pressure { get; set; }
public int humidity { get; set; }
public double temp_min { get; set; }
public double temp_max { get; set; }
--- /dev/null
+using System;
+
+namespace WeatherInformation.Model.CurrentWeatherParser
+{
+ public class Snow
+ {
+ private double threeHours;
+
+ public void set3h(double three)
+ {
+ this.threeHours = three;
+ }
+
+ public double get3h()
+ {
+ return this.threeHours;
+ }
+ }
+}
+
public class Wind
{
public double speed { get; set; }
- public int deg { get; set; }
+ public double deg { get; set; }
}
}
}
/// <summary>
+ /// Busca una cadena traducida similar a CLOUDS.
+ /// </summary>
+ public static string MainPageCurrentClouds {
+ get {
+ return ResourceManager.GetString("MainPageCurrentClouds", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Busca una cadena traducida similar a %.
+ /// </summary>
+ public static string MainPageCurrentCloudsUnits {
+ get {
+ return ResourceManager.GetString("MainPageCurrentCloudsUnits", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Busca una cadena traducida similar a FEELS LIKE.
+ /// </summary>
+ public static string MainPageCurrentFeelsLike {
+ get {
+ return ResourceManager.GetString("MainPageCurrentFeelsLike", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Busca una cadena traducida similar a current.
/// </summary>
public static string MainPageCurrentHeader {
}
/// <summary>
+ /// Busca una cadena traducida similar a HUMIDITY.
+ /// </summary>
+ public static string MainPageCurrentHumidity {
+ get {
+ return ResourceManager.GetString("MainPageCurrentHumidity", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Busca una cadena traducida similar a %.
+ /// </summary>
+ public static string MainPageCurrentHumidityUnits {
+ get {
+ return ResourceManager.GetString("MainPageCurrentHumidityUnits", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Busca una cadena traducida similar a PRESSURE.
+ /// </summary>
+ public static string MainPageCurrentPressure {
+ get {
+ return ResourceManager.GetString("MainPageCurrentPressure", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Busca una cadena traducida similar a hpa.
+ /// </summary>
+ public static string MainPageCurrentPressureUnits {
+ get {
+ return ResourceManager.GetString("MainPageCurrentPressureUnits", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Busca una cadena traducida similar a RAIN.
+ /// </summary>
+ public static string MainPageCurrentRain {
+ get {
+ return ResourceManager.GetString("MainPageCurrentRain", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Busca una cadena traducida similar a mm 3h.
+ /// </summary>
+ public static string MainPageCurrentRainUnits {
+ get {
+ return ResourceManager.GetString("MainPageCurrentRainUnits", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Busca una cadena traducida similar a SNOW.
+ /// </summary>
+ public static string MainPageCurrentSnow {
+ get {
+ return ResourceManager.GetString("MainPageCurrentSnow", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Busca una cadena traducida similar a mm 3h.
+ /// </summary>
+ public static string MainPageCurrentSnowUnits {
+ get {
+ return ResourceManager.GetString("MainPageCurrentSnowUnits", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Busca una cadena traducida similar a SUN RISE.
+ /// </summary>
+ public static string MainPageCurrentSunRise {
+ get {
+ return ResourceManager.GetString("MainPageCurrentSunRise", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Busca una cadena traducida similar a SUN SET.
+ /// </summary>
+ public static string MainPageCurrentSunSet {
+ get {
+ return ResourceManager.GetString("MainPageCurrentSunSet", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Busca una cadena traducida similar a WIND.
+ /// </summary>
+ public static string MainPageCurrentWind {
+ get {
+ return ResourceManager.GetString("MainPageCurrentWind", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Busca una cadena traducida similar a m/s.
+ /// </summary>
+ public static string MainPageCurrentWindUnits {
+ get {
+ return ResourceManager.GetString("MainPageCurrentWindUnits", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Busca una cadena traducida similar a forecast.
/// </summary>
public static string MainPageForecastHeader {
}
/// <summary>
+ /// Busca una cadena traducida similar a http://api.openweathermap.org/data/{0}/weather?lat={1}&lon={2}&cnt=1.
+ /// </summary>
+ public static string URIAPIOpenWeatherMapCurrent {
+ get {
+ return ResourceManager.GetString("URIAPIOpenWeatherMapCurrent", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Busca una cadena traducida similar a http://api.openweathermap.org/data/{0}/forecast/daily?lat={1}&lon={2}&cnt={3}&mode=json.
/// </summary>
public static string URIAPIOpenWeatherMapForecast {
<value>es</value>
<comment>Controls the Language and ensures that the font for all elements in the RootFrame aligns with the app's language. Set to the language code of this resource file's language.</comment>
</data>
-
-
-
-
-
-
-
-
-
-<data name="ApplicationTitle" xml:space="preserve"><value>MI APLICACIÓN</value></data><data name="AppBarButtonText" xml:space="preserve"><value>agregar</value></data><data name="AppBarMenuItemText" xml:space="preserve"><value>Elemento de menú</value></data><data name="SettingsLanguageHeader" xml:space="preserve"><value>Idioma</value><comment>Text in settings page as header</comment></data><data name="SettingsTemperatureUnitsHeader" xml:space="preserve"><value>Unidades de temperatura</value><comment>Text in settings page</comment></data><data name="SettingsLanguageSelectionEnglish" xml:space="preserve"><value>inglés</value><comment>Settings page, select English language</comment></data><data name="SettingsLanguageSelectionSpanish" xml:space="preserve"><value>español</value><comment>Settings page, select Spanish language</comment></data><data name="SettingsTemperatureUnitsSelectionCentigrade" xml:space="preserve"><value>celsius</value><comment>Settings page, select tempereature units centigrade</comment></data><data name="SettingsTemperatureUnitsSelectionFahrenheit" xml:space="preserve"><value>fahrenheit</value><comment>Settings page, select temperature units fahrenheit</comment></data><data name="AskForLocationConsentMessageBoxCaption" xml:space="preserve"><value>Localización</value><comment>Ask for location consent in map window</comment></data><data name="NoticeThereIsNotCurrentLocation" xml:space="preserve"><value>No hay localizaciones almacenadas.</value><comment>Main window, notice message, no available locations</comment></data><data name="NoticeErrorLocationAutodetection" xml:space="preserve"><value>Detección automática de la ubicación parece ser desactivado en el teléfono</value><comment>Map window, notice message, error while location autodetection</comment></data><data name="SettingsForecastDayNumbersHeader" xml:space="preserve"><value>Prevision, numero días</value><comment>Text in settings page as header</comment></data><data name="SettingsForecastDayNumbersSelectionTen" xml:space="preserve"><value>Previsión 10 días</value><comment>Settings page, select forecast day numbers</comment></data><data name="SettingsForecastDayNumbersSelectionFourteen" xml:space="preserve"><value>Previsión 14 días</value><comment>Settings page, select forecast day numbers</comment></data><data name="SettingsForecastDayNumbersSelectionFive" xml:space="preserve"><value>Previsión 5 días</value><comment>Settings page, select forecast day numbers</comment></data><data name="TemperatureUnitsFahrenheitSymbol" xml:space="preserve"><value>º F</value></data><data name="LocationPageSubTitle" xml:space="preserve"><value>Ciudad, país</value><comment>Subtitle in location page</comment></data><data name="LocationPageTitle" xml:space="preserve"><value>Selecciona tu localización</value><comment>Title in location page</comment></data><data name="MainPageForecastHeader" xml:space="preserve"><value>previsión</value><comment>Forecast header in main page</comment></data><data name="SettingsPageHeaderSettings" xml:space="preserve"><value>configuración de</value><comment>Header settings in settings page</comment></data><data name="MainPageCurrentHeader" xml:space="preserve"><value>actual</value><comment>Current header in main page</comment></data><data name="TemperatureUnitsCentigradeSymbol" xml:space="preserve"><value>º C</value></data><data name="AskForLocationConsentMessageBox" xml:space="preserve"><value>Esta aplicación accede a los datos de tu localización. ¿Estás de acuerdo?</value><comment>Ask for location consent in map window</comment></data><data name="MainPageTitle" xml:space="preserve"><value>Ciudad, país</value><comment>Title in main page</comment></data></root>
\ No newline at end of file
+ <data name="ApplicationTitle" xml:space="preserve">
+ <value>MI APLICACIÓN</value>
+ </data>
+ <data name="AppBarButtonText" xml:space="preserve">
+ <value>agregar</value>
+ </data>
+ <data name="AppBarMenuItemText" xml:space="preserve">
+ <value>Elemento de menú</value>
+ </data>
+ <data name="SettingsLanguageHeader" xml:space="preserve">
+ <value>Idioma</value>
+ <comment>Text in settings page as header</comment>
+ </data>
+ <data name="SettingsTemperatureUnitsHeader" xml:space="preserve">
+ <value>Unidades de temperatura</value>
+ <comment>Text in settings page</comment>
+ </data>
+ <data name="SettingsLanguageSelectionEnglish" xml:space="preserve">
+ <value>inglés</value>
+ <comment>Settings page, select English language</comment>
+ </data>
+ <data name="SettingsLanguageSelectionSpanish" xml:space="preserve">
+ <value>español</value>
+ <comment>Settings page, select Spanish language</comment>
+ </data>
+ <data name="SettingsTemperatureUnitsSelectionCentigrade" xml:space="preserve">
+ <value>celsius</value>
+ <comment>Settings page, select tempereature units centigrade</comment>
+ </data>
+ <data name="SettingsTemperatureUnitsSelectionFahrenheit" xml:space="preserve">
+ <value>fahrenheit</value>
+ <comment>Settings page, select temperature units fahrenheit</comment>
+ </data>
+ <data name="AskForLocationConsentMessageBoxCaption" xml:space="preserve">
+ <value>Localización</value>
+ <comment>Ask for location consent in map window</comment>
+ </data>
+ <data name="NoticeThereIsNotCurrentLocation" xml:space="preserve">
+ <value>No hay localizaciones almacenadas.</value>
+ <comment>Main window, notice message, no available locations</comment>
+ </data>
+ <data name="NoticeErrorLocationAutodetection" xml:space="preserve">
+ <value>Detección automática de la ubicación parece estar desactivada en el teléfono</value>
+ <comment>Map window, notice message, error while location autodetection</comment>
+ </data>
+ <data name="SettingsForecastDayNumbersHeader" xml:space="preserve">
+ <value>Prevision, numero días</value>
+ <comment>Text in settings page as header</comment>
+ </data>
+ <data name="SettingsForecastDayNumbersSelectionTen" xml:space="preserve">
+ <value>Previsión 10 días</value>
+ <comment>Settings page, select forecast day numbers</comment>
+ </data>
+ <data name="SettingsForecastDayNumbersSelectionFourteen" xml:space="preserve">
+ <value>Previsión 14 días</value>
+ <comment>Settings page, select forecast day numbers</comment>
+ </data>
+ <data name="SettingsForecastDayNumbersSelectionFive" xml:space="preserve">
+ <value>Previsión 5 días</value>
+ <comment>Settings page, select forecast day numbers</comment>
+ </data>
+ <data name="LocationPageSubTitle" xml:space="preserve">
+ <value>Ciudad, país</value>
+ <comment>Subtitle in location page</comment>
+ </data>
+ <data name="LocationPageTitle" xml:space="preserve">
+ <value>Selecciona tu localización</value>
+ <comment>Title in location page</comment>
+ </data>
+ <data name="MainPageForecastHeader" xml:space="preserve">
+ <value>previsión</value>
+ <comment>Forecast header in main page</comment>
+ </data>
+ <data name="SettingsPageHeaderSettings" xml:space="preserve">
+ <value>configuración de</value>
+ <comment>Header settings in settings page</comment>
+ </data>
+ <data name="MainPageCurrentHeader" xml:space="preserve">
+ <value>actual</value>
+ <comment>Current header in main page</comment>
+ </data>
+ <data name="AskForLocationConsentMessageBox" xml:space="preserve">
+ <value>Esta aplicación accede a los datos de tu localización. ¿Estás de acuerdo?</value>
+ <comment>Ask for location consent in map window</comment>
+ </data>
+ <data name="MainPageTitle" xml:space="preserve">
+ <value>Ciudad, país</value>
+ <comment>Title in main page</comment>
+ </data>
+ <data name="MainPageCurrentWind" xml:space="preserve">
+ <value>VIENTO</value>
+ </data>
+ <data name="MainPageCurrentSunSet" xml:space="preserve">
+ <value>SOL SE PONE</value>
+ </data>
+ <data name="MainPageCurrentSunRise" xml:space="preserve">
+ <value>SOL SALE</value>
+ </data>
+ <data name="MainPageCurrentSnow" xml:space="preserve">
+ <value>NIEVE</value>
+ </data>
+ <data name="MainPageCurrentRain" xml:space="preserve">
+ <value>LLUVIA</value>
+ </data>
+ <data name="MainPageCurrentPressure" xml:space="preserve">
+ <value>PRESIÓN</value>
+ </data>
+ <data name="MainPageCurrentHumidity" xml:space="preserve">
+ <value>HUMEDAD</value>
+ </data>
+ <data name="MainPageCurrentClouds" xml:space="preserve">
+ <value>NUBES</value>
+ </data>
+ <data name="MainPageCurrentFeelsLike" xml:space="preserve">
+ <value>SIENTE COMO</value>
+ </data>
+</root>
\ No newline at end of file
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="es" original="AppResources.resx" tool-id="MultilingualAppToolkit" product-name="WeatherInformation" product-version="1.0.0.0" build-num="0">
<header>
- <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="3.0.1200.0" tool-company="Microsoft" />
+ <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="3.1.1085.0" tool-company="Microsoft" />
</header>
<body>
<group id="Resx">
</trans-unit>
<trans-unit id="Resx/NoticeErrorLocationAutodetection" translate="yes" xml:space="preserve">
<source>Location autodetection seems to be disabled in your phone</source>
- <target state="needs-review-translation" state-qualifier="mt-suggestion">Detección automática de la ubicación parece ser desactivado en el teléfono</target>
+ <target state="translated">Detección automática de la ubicación parece estar desactivada en el teléfono</target>
<note from="MultilingualBuild" annotates="source" priority="2">Map window, notice message, error while location autodetection</note>
</trans-unit>
<trans-unit id="Resx/SettingsForecastDayNumbersHeader" translate="yes" xml:space="preserve">
<target state="translated">Previsión 5 días</target>
<note from="MultilingualBuild" annotates="source" priority="2">Settings page, select forecast day numbers</note>
</trans-unit>
- <trans-unit id="Resx/TemperatureUnitsFahrenheitSymbol" translate="yes" xml:space="preserve">
+ <trans-unit id="Resx/TemperatureUnitsFahrenheitSymbol" translate="no" xml:space="preserve">
<source>ºF</source>
- <target state="translated" state-qualifier="mt-suggestion">º F</target>
+ <target state="needs-review-translation" state-qualifier="mt-suggestion">º F</target>
</trans-unit>
<trans-unit id="Resx/LocationPageSubTitle" translate="yes" xml:space="preserve">
<source>City, country</source>
<target state="translated">Ciudad, país</target>
<note from="MultilingualBuild" annotates="source" priority="2">Title in main page</note>
</trans-unit>
+ <trans-unit id="Resx/MainPageCurrentWind" translate="yes" xml:space="preserve">
+ <source>WIND</source>
+ <target state="translated">VIENTO</target>
+ </trans-unit>
+ <trans-unit id="Resx/URIAPIOpenWeatherMapCurrent" translate="no" xml:space="preserve">
+ <source>http://api.openweathermap.org/data/{0}/weather?lat={1}%%amp;lon={2}%%amp;cnt=1</source>
+ <target state="new">http://api.openweathermap.org/data/{0}/weather?lat={1}%%amp;lon={2}%%amp;cnt=1</target>
+ <note from="MultilingualBuild" annotates="source" priority="2">Not to be translated</note>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentWindUnits" translate="yes" xml:space="preserve">
+ <source>m/s</source>
+ <target state="new">m/s</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentPressureUnits" translate="yes" xml:space="preserve">
+ <source>hpa</source>
+ <target state="new">hpa</target>
+ <note from="MultilingualBuild" annotates="source" priority="2">Not to be translated.</note>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentSnowUnits" translate="yes" xml:space="preserve">
+ <source>mm 3h</source>
+ <target state="new">mm 3h</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentRainUnits" translate="yes" xml:space="preserve">
+ <source>mm 3h</source>
+ <target state="new">mm 3h</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentHumidityUnits" translate="yes" xml:space="preserve">
+ <source>%</source>
+ <target state="new">%</target>
+ <note from="MultilingualBuild" annotates="source" priority="2">Not to be translated.</note>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentCloudsUnits" translate="yes" xml:space="preserve">
+ <source>%</source>
+ <target state="new">%</target>
+ <note from="MultilingualBuild" annotates="source" priority="2">Not to be translated.</note>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentSunSet" translate="yes" xml:space="preserve">
+ <source>SUN SET</source>
+ <target state="translated">SOL SE PONE</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentSunRise" translate="yes" xml:space="preserve">
+ <source>SUN RISE</source>
+ <target state="translated">SOL SALE</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentSnow" translate="yes" xml:space="preserve">
+ <source>SNOW</source>
+ <target state="translated">NIEVE</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentRain" translate="yes" xml:space="preserve">
+ <source>RAIN</source>
+ <target state="translated">LLUVIA</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentPressure" translate="yes" xml:space="preserve">
+ <source>PRESSURE</source>
+ <target state="translated">PRESIÓN</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentHumidity" translate="yes" xml:space="preserve">
+ <source>HUMIDITY</source>
+ <target state="translated">HUMEDAD</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentFeelsLike" translate="yes" xml:space="preserve">
+ <source>FEELS LIKE</source>
+ <target state="translated">SIENTE COMO</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentClouds" translate="yes" xml:space="preserve">
+ <source>CLOUDS</source>
+ <target state="translated">NUBES</target>
+ </trans-unit>
<trans-unit id="Resx/MainPageCurrentHeader" translate="yes" xml:space="preserve">
<source>current</source>
<target state="translated" state-qualifier="mt-suggestion">actual</target>
<note from="MultilingualBuild" annotates="source" priority="2">Current header in main page</note>
</trans-unit>
- <trans-unit id="Resx/TemperatureUnitsCentigradeSymbol" translate="yes" xml:space="preserve">
+ <trans-unit id="Resx/TemperatureUnitsCentigradeSymbol" translate="no" xml:space="preserve">
<source>ºC</source>
<target state="needs-review-translation" state-qualifier="mt-suggestion">º C</target>
</trans-unit>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="qps-ploc" original="AppResources.resx" tool-id="MultilingualAppToolkit" product-name="WeatherInformation" product-version="1.0.0.0" build-num="0">
<header>
- <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="3.0.1200.0" tool-company="Microsoft" />
+ <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="3.1.1085.0" tool-company="Microsoft" />
</header>
<body>
<group id="Resx">
<target state="new">City, country</target>
<note from="MultilingualBuild" annotates="source" priority="2">Title in main page</note>
</trans-unit>
+ <trans-unit id="Resx/MainPageCurrentWind" translate="yes" xml:space="preserve">
+ <source>WIND</source>
+ <target state="new">WIND</target>
+ </trans-unit>
+ <trans-unit id="Resx/URIAPIOpenWeatherMapCurrent" translate="yes" xml:space="preserve">
+ <source>http://api.openweathermap.org/data/{0}/weather?lat={1}%%amp;lon={2}%%amp;cnt=1</source>
+ <target state="new">http://api.openweathermap.org/data/{0}/weather?lat={1}%%amp;lon={2}%%amp;cnt=1</target>
+ <note from="MultilingualBuild" annotates="source" priority="2">Not to be translated</note>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentWindUnits" translate="yes" xml:space="preserve">
+ <source>m/s</source>
+ <target state="new">m/s</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentPressureUnits" translate="yes" xml:space="preserve">
+ <source>hpa</source>
+ <target state="new">hpa</target>
+ <note from="MultilingualBuild" annotates="source" priority="2">Not to be translated.</note>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentSnowUnits" translate="yes" xml:space="preserve">
+ <source>mm 3h</source>
+ <target state="new">mm 3h</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentRainUnits" translate="yes" xml:space="preserve">
+ <source>mm 3h</source>
+ <target state="new">mm 3h</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentHumidityUnits" translate="yes" xml:space="preserve">
+ <source>%</source>
+ <target state="new">%</target>
+ <note from="MultilingualBuild" annotates="source" priority="2">Not to be translated.</note>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentCloudsUnits" translate="yes" xml:space="preserve">
+ <source>%</source>
+ <target state="new">%</target>
+ <note from="MultilingualBuild" annotates="source" priority="2">Not to be translated.</note>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentSunSet" translate="yes" xml:space="preserve">
+ <source>SUN SET</source>
+ <target state="new">SUN SET</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentSunRise" translate="yes" xml:space="preserve">
+ <source>SUN RISE</source>
+ <target state="new">SUN RISE</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentSnow" translate="yes" xml:space="preserve">
+ <source>SNOW</source>
+ <target state="new">SNOW</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentRain" translate="yes" xml:space="preserve">
+ <source>RAIN</source>
+ <target state="new">RAIN</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentPressure" translate="yes" xml:space="preserve">
+ <source>PRESSURE</source>
+ <target state="new">PRESSURE</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentHumidity" translate="yes" xml:space="preserve">
+ <source>HUMIDITY</source>
+ <target state="new">HUMIDITY</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentFeelsLike" translate="yes" xml:space="preserve">
+ <source>FEELS LIKE</source>
+ <target state="new">FEELS LIKE</target>
+ </trans-unit>
+ <trans-unit id="Resx/MainPageCurrentClouds" translate="yes" xml:space="preserve">
+ <source>CLOUDS</source>
+ <target state="new">CLOUDS</target>
+ </trans-unit>
<trans-unit id="Resx/MainPageCurrentHeader" translate="yes" xml:space="preserve">
<source>current</source>
<target state="new">current</target>
<value>City, country</value>
<comment>Title in main page</comment>
</data>
+ <data name="MainPageCurrentClouds" xml:space="preserve">
+ <value>CLOUDS</value>
+ </data>
+ <data name="MainPageCurrentFeelsLike" xml:space="preserve">
+ <value>FEELS LIKE</value>
+ </data>
+ <data name="MainPageCurrentHumidity" xml:space="preserve">
+ <value>HUMIDITY</value>
+ </data>
+ <data name="MainPageCurrentPressure" xml:space="preserve">
+ <value>PRESSURE</value>
+ </data>
+ <data name="MainPageCurrentRain" xml:space="preserve">
+ <value>RAIN</value>
+ </data>
+ <data name="MainPageCurrentSnow" xml:space="preserve">
+ <value>SNOW</value>
+ </data>
+ <data name="MainPageCurrentSunRise" xml:space="preserve">
+ <value>SUN RISE</value>
+ </data>
+ <data name="MainPageCurrentSunSet" xml:space="preserve">
+ <value>SUN SET</value>
+ </data>
+ <data name="MainPageCurrentWind" xml:space="preserve">
+ <value>WIND</value>
+ </data>
+ <data name="URIAPIOpenWeatherMapCurrent" xml:space="preserve">
+ <value>http://api.openweathermap.org/data/{0}/weather?lat={1}&lon={2}&cnt=1</value>
+ <comment>Not to be translated</comment>
+ </data>
+ <data name="MainPageCurrentCloudsUnits" xml:space="preserve">
+ <value>%</value>
+ <comment>Not to be translated.</comment>
+ </data>
+ <data name="MainPageCurrentHumidityUnits" xml:space="preserve">
+ <value>%</value>
+ <comment>Not to be translated.</comment>
+ </data>
+ <data name="MainPageCurrentRainUnits" xml:space="preserve">
+ <value>mm 3h</value>
+ </data>
+ <data name="MainPageCurrentSnowUnits" xml:space="preserve">
+ <value>mm 3h</value>
+ </data>
+ <data name="MainPageCurrentWindUnits" xml:space="preserve">
+ <value>m/s</value>
+ </data>
+ <data name="MainPageCurrentPressureUnits" xml:space="preserve">
+ <value>hpa</value>
+ <comment>Not to be translated.</comment>
+ </data>
</root>
\ No newline at end of file
<vm:MainViewModel
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:vm="clr-namespace:WeatherInformation.ViewModels">
+ xmlns:vm="clr-namespace:WeatherInformation.ViewModels"
+ CurrentMaxTemp="25"
+ CurrentMaxTempUnits="ºC"
+ CurrentMinTemp="15"
+ CurrentFeelsLikeTemp="20"
+ CurrentPressure="1015"
+ CurrentRain="10"
+ CurrentSnow="10"
+ CurrentSunRise="2014.07.19 07:01:54"
+ CurrentSunSet="2014.07.19 21:41:40"
+ CurrentWind="1.03"
+ CurrentConditions="Sky is Clear"
+ CurrentClouds="10"
+ CurrentHumidity="50"
+ CurrentMinTempUnits="ºC"
+ CurrentPressureUnits="hpa"
+ CurrentRainUnits="mm 3h"
+ CurrentSnowUnits="mm 3h"
+ CurrentWindUnits="m/s"
+ CurrentHumidityUnits="%"
+ CurrentFeelsLikeTempUnits="ºC"
+ CurrentCloudsUnits="%">
<vm:MainViewModel.ForecastItems>
<vm:ItemViewModel LineOne="MON" LineTwo="1" LineThree="15ºC" LineFour="10ºC" LineFive="/Assets/Tiles/IconicTileMediumLarge.png"/>
<vm:ItemViewModel LineOne="FRI 5" LineTwo="13ºC" LineThree="/Assets/Tiles/IconicTileMediumLarge.png"/>
<vm:ItemViewModel LineOne="SAT 6" LineTwo="20ºC" LineThree="/Assets/Tiles/IconicTileMediumLarge.png"/>
</vm:MainViewModel.CurrentItems>
+
</vm:MainViewModel>
\ No newline at end of file
namespace WeatherInformation.ViewModels
{
- public class MainViewModel
+ public class MainViewModel : INotifyPropertyChanged
{
// The key names of _settings
// TODO: reuse settings object instead of using the same code here again...
/// </summary>
public ObservableCollection<ItemViewModel> ForecastItems{ get; private set; }
public ObservableCollection<ItemViewModel> CurrentItems { get; private set; }
-
+ public String CurrentMaxTemp { get; set; }
+ public String CurrentMaxTempUnits { get; set; }
+ public String CurrentMinTemp { get; private set; }
+ public String CurrentMinTempUnits { get; set; }
+ public String CurrentConditions { get; private set; }
+ public String CurrentFeelsLikeTemp { get; private set; }
+ public String CurrentFeelsLikeTempUnits { get; set; }
+ public String CurrentHumidity { get; private set; }
+ public String CurrentHumidityUnits { get; private set; }
+ public String CurrentRain { get; private set; }
+ public String CurrentRainUnits { get; private set; }
+ public String CurrentSnow { get; private set; }
+ public String CurrentSnowUnits { get; private set; }
+ public String CurrentWind { get; private set; }
+ public String CurrentWindUnits { get; private set; }
+ public String CurrentClouds { get; private set; }
+ public String CurrentCloudsUnits { get; private set; }
+ public String CurrentPressure { get; private set; }
+ public String CurrentPressureUnits { get; private set; }
+ public String CurrentSunRise { get; private set; }
+ public String CurrentSunSet { get; private set; }
/// <summary>
/// Crear y agregar unos pocos objetos ItemViewModel a la colección Items.
var remoteForecastWeatherData = weatherData.RemoteForecastWeatherData;
this.ForecastItems.Clear();
+ DateTime unixTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
foreach (WeatherInformation.Model.ForecastWeatherParser.List item in remoteForecastWeatherData.list)
{
- DateTime unixTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
DateTime date = unixTime.AddSeconds(item.dt).ToLocalTime();
// TODO: if I do not receive max temp or min temp... Am I going to receive item.temp.max=0 or item.temp.min=0 (I guess because
break;
}
}
+
+ // TODO: nullables?
+
+ var remoteCurrentWeatherData = weatherData.RemoteCurrentWeatherData;
+
+ var currentMaxTemp = "";
+ if (remoteCurrentWeatherData.main != null)
+ {
+ var conversion = remoteCurrentWeatherData.main.temp_max;
+ conversion -= tempUnits;
+ currentMaxTemp = String.Format(CultureInfo.InvariantCulture, "{0:0.##}", conversion);
+ }
+ this.CurrentMaxTemp = currentMaxTemp;
+ this.CurrentMaxTempUnits = symbol;
+ NotifyPropertyChanged("CurrentMaxTemp");
+ NotifyPropertyChanged("CurrentMaxTempUnits");
+
+ var currentMinTemp = "";
+ if (remoteCurrentWeatherData.main != null)
+ {
+ var conversion = remoteCurrentWeatherData.main.temp_min;
+ conversion -= tempUnits;
+ currentMinTemp = String.Format(CultureInfo.InvariantCulture, "{0:0.##}", conversion);
+ }
+ this.CurrentMinTemp = currentMinTemp;
+ this.CurrentMinTempUnits = symbol;
+ NotifyPropertyChanged("CurrentMinTemp");
+ NotifyPropertyChanged("CurrentMinTempUnits");
+
+ var currentConditions = "no description available";
+ if (remoteCurrentWeatherData.weather.Count > 0)
+ {
+ currentConditions = remoteCurrentWeatherData.weather[0].description;
+ }
+ this.CurrentConditions = currentConditions;
+ NotifyPropertyChanged("CurrentConditions");
+
+ var currentFeelsLikeTemp = "";
+ if (remoteCurrentWeatherData.main != null)
+ {
+ var conversion = remoteCurrentWeatherData.main.temp;
+ conversion -= tempUnits;
+ currentFeelsLikeTemp = String.Format(CultureInfo.InvariantCulture, "{0:0.##}", conversion);
+ }
+ this.CurrentFeelsLikeTemp = currentFeelsLikeTemp;
+ this.CurrentFeelsLikeTempUnits = symbol;
+ NotifyPropertyChanged("CurrentFeelsLikeTemp");
+ NotifyPropertyChanged("CurrentFeelsLikeTempUnits");
+
+ var currentHumidity = "";
+ if (remoteCurrentWeatherData.main != null)
+ {
+ currentHumidity = remoteCurrentWeatherData.main.humidity.ToString(CultureInfo.InvariantCulture);
+ }
+ this.CurrentHumidity = currentHumidity;
+ this.CurrentHumidityUnits = AppResources.MainPageCurrentHumidityUnits;
+ NotifyPropertyChanged("CurrentHumidity");
+ NotifyPropertyChanged("CurrentHumidityUnits");
+
+ var currentRain = "";
+ if (remoteCurrentWeatherData.rain != null)
+ {
+ currentRain = remoteCurrentWeatherData.rain.get3h().ToString(CultureInfo.InvariantCulture);
+ }
+ this.CurrentRain = currentRain;
+ this.CurrentRainUnits = AppResources.MainPageCurrentRainUnits;
+ NotifyPropertyChanged("CurrentRain");
+ NotifyPropertyChanged("CurrentRainUnits");
+
+ var currentSnow = "";
+ if (remoteCurrentWeatherData.snow != null)
+ {
+ currentSnow = remoteCurrentWeatherData.snow.get3h().ToString(CultureInfo.InvariantCulture);
+ }
+ this.CurrentSnow = currentSnow;
+ this.CurrentSnowUnits = AppResources.MainPageCurrentSnowUnits;
+ NotifyPropertyChanged("CurrentSnow");
+ NotifyPropertyChanged("CurrentSnowUnits");
+
+ var currentWind = "";
+ if (remoteCurrentWeatherData.wind != null)
+ {
+ currentWind = remoteCurrentWeatherData.wind.speed.ToString(CultureInfo.InvariantCulture);
+ }
+ this.CurrentWind = currentWind;
+ this.CurrentWindUnits = AppResources.MainPageCurrentWindUnits;
+ NotifyPropertyChanged("CurrentWind");
+ NotifyPropertyChanged("CurrentWindUnits");
+
+ var currentClouds = "";
+ if (remoteCurrentWeatherData.clouds != null)
+ {
+ currentClouds = remoteCurrentWeatherData.clouds.all.ToString(CultureInfo.InvariantCulture);
+ }
+ this.CurrentClouds = currentClouds;
+ this.CurrentCloudsUnits = AppResources.MainPageCurrentCloudsUnits;
+ NotifyPropertyChanged("CurrentClouds");
+ NotifyPropertyChanged("CurrentCloudsUnits");
+
+ var currentPressure = "";
+ if (remoteCurrentWeatherData.main != null)
+ {
+ currentPressure = remoteCurrentWeatherData.main.pressure.ToString(CultureInfo.InvariantCulture);
+ }
+ this.CurrentPressure = currentPressure;
+ this.CurrentPressureUnits = AppResources.MainPageCurrentPressureUnits;
+ NotifyPropertyChanged("CurrentPressure");
+ NotifyPropertyChanged("CurrentPressureUnits");
+
+ var sunRiseTime = unixTime.AddSeconds(remoteCurrentWeatherData.sys.sunrise).ToLocalTime();
+ this.CurrentSunRise = sunRiseTime.ToString("MM/dd/yy H:mm:ss", CultureInfo.InvariantCulture);
+ NotifyPropertyChanged("CurrentSunRise");
+
+ var sunSetTime = unixTime.AddSeconds(remoteCurrentWeatherData.sys.sunset).ToLocalTime();
+ this.CurrentSunSet = sunSetTime.ToString("MM/dd/yy H:mm:ss", CultureInfo.InvariantCulture);
+ NotifyPropertyChanged("CurrentSunSet");
}
public bool IsThereCurrentLocation()
}
return value;
}
+
+ public event PropertyChangedEventHandler PropertyChanged;
+ private void NotifyPropertyChanged(String propertyName)
+ {
+ PropertyChangedEventHandler handler = PropertyChanged;
+ if (null != handler)
+ {
+ handler(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
}
}
\ No newline at end of file
<Compile Include="Model\CurrentWeatherParser\Coord.cs" />
<Compile Include="Model\CurrentWeatherParser\CurrentWeather.cs" />
<Compile Include="Model\CurrentWeatherParser\Main.cs" />
+ <Compile Include="Model\CurrentWeatherParser\Snow.cs" />
<Compile Include="Model\CurrentWeatherParser\Rain.cs" />
<Compile Include="Model\CurrentWeatherParser\Sys.cs" />
<Compile Include="Model\CurrentWeatherParser\Weather.cs" />