WeatherInformation WP8:
authorgu.martinm@gmail.com <gu.martinm@gmail.com>
Sat, 16 Aug 2014 20:19:42 +0000 (22:19 +0200)
committergu.martinm@gmail.com <gu.martinm@gmail.com>
Sat, 16 Aug 2014 20:19:42 +0000 (22:19 +0200)
Weather pictures plus UTC time instead of local time.

24 files changed:
WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_clear.png [new file with mode: 0644]
WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_clear_night.png [new file with mode: 0644]
WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_few_clouds.png [new file with mode: 0644]
WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_few_clouds_night.png [new file with mode: 0644]
WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_fog.png [new file with mode: 0644]
WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_overcast.png [new file with mode: 0644]
WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_severe_alert.png [new file with mode: 0644]
WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_showers.png [new file with mode: 0644]
WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_showers_scattered.png [new file with mode: 0644]
WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_snow.png [new file with mode: 0644]
WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_storm.png [new file with mode: 0644]
WindowsPhone/WeatherInformation/WeatherInformation/MainPage.xaml
WindowsPhone/WeatherInformation/WeatherInformation/Model/Images/RemoteImagesTranslation.cs [new file with mode: 0644]
WindowsPhone/WeatherInformation/WeatherInformation/Resources/AppResources.Designer.cs
WindowsPhone/WeatherInformation/WeatherInformation/Resources/AppResources.es.resx
WindowsPhone/WeatherInformation/WeatherInformation/Resources/AppResources.es.xlf
WindowsPhone/WeatherInformation/WeatherInformation/Resources/AppResources.qps-ploc.xlf
WindowsPhone/WeatherInformation/WeatherInformation/Resources/AppResources.resx
WindowsPhone/WeatherInformation/WeatherInformation/SampleData/MainViewModelSampleData.xaml
WindowsPhone/WeatherInformation/WeatherInformation/SampleData/SelectedDateViewModelSampleData.xaml
WindowsPhone/WeatherInformation/WeatherInformation/SelectedDatePage.xaml
WindowsPhone/WeatherInformation/WeatherInformation/ViewModels/MainViewModel.cs
WindowsPhone/WeatherInformation/WeatherInformation/ViewModels/SelectedDateViewModel.cs
WindowsPhone/WeatherInformation/WeatherInformation/WeatherInformation.csproj

diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_clear.png b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_clear.png
new file mode 100644 (file)
index 0000000..73a5bbd
Binary files /dev/null and b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_clear.png differ
diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_clear_night.png b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_clear_night.png
new file mode 100644 (file)
index 0000000..2c60054
Binary files /dev/null and b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_clear_night.png differ
diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_few_clouds.png b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_few_clouds.png
new file mode 100644 (file)
index 0000000..2d38702
Binary files /dev/null and b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_few_clouds.png differ
diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_few_clouds_night.png b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_few_clouds_night.png
new file mode 100644 (file)
index 0000000..333afa7
Binary files /dev/null and b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_few_clouds_night.png differ
diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_fog.png b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_fog.png
new file mode 100644 (file)
index 0000000..1bebc54
Binary files /dev/null and b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_fog.png differ
diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_overcast.png b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_overcast.png
new file mode 100644 (file)
index 0000000..e3101eb
Binary files /dev/null and b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_overcast.png differ
diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_severe_alert.png b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_severe_alert.png
new file mode 100644 (file)
index 0000000..b0ac4b7
Binary files /dev/null and b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_severe_alert.png differ
diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_showers.png b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_showers.png
new file mode 100644 (file)
index 0000000..6a1860c
Binary files /dev/null and b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_showers.png differ
diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_showers_scattered.png b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_showers_scattered.png
new file mode 100644 (file)
index 0000000..97d0f77
Binary files /dev/null and b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_showers_scattered.png differ
diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_snow.png b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_snow.png
new file mode 100644 (file)
index 0000000..ac714cc
Binary files /dev/null and b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_snow.png differ
diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_storm.png b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_storm.png
new file mode 100644 (file)
index 0000000..c339221
Binary files /dev/null and b/WindowsPhone/WeatherInformation/WeatherInformation/Images/weather_storm.png differ
index a0d3cff..5d73b4e 100644 (file)
@@ -96,7 +96,7 @@
                             <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" />
+                            <Image Source="{Binding CurrentWeatherImagePath}" Width="100" Height="100" Margin="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"/>
diff --git a/WindowsPhone/WeatherInformation/WeatherInformation/Model/Images/RemoteImagesTranslation.cs b/WindowsPhone/WeatherInformation/WeatherInformation/Model/Images/RemoteImagesTranslation.cs
new file mode 100644 (file)
index 0000000..b62df75
--- /dev/null
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace WeatherInformation.Model.Images
+{
+    class RemoteImagesTranslation
+    {
+        // C# Language Specification§10.11
+        // If a class contains any static fields with initializers, those initializers are executed
+        // in textual order immediately prior to executing the static constructor.
+        private readonly static Dictionary<string, string> images = new Dictionary<string, string>();
+
+        static RemoteImagesTranslation()
+        {
+            images.Add("01d", "weather_clear");
+            images.Add("01n", "weather_clear_night");
+            images.Add("02d", "weather_few_clouds");
+            images.Add("02n", "weather_few_clouds_night");
+            images.Add("03d", "weather_few_clouds");
+            images.Add("03n", "weather_few_clouds");
+            images.Add("04d", "weather_overcast");
+            images.Add("04n", "weather_overcast");
+            images.Add("09d", "weather_showers");
+            images.Add("09n", "weather_showers");
+            images.Add("10d", "weather_showers_scattered");
+            images.Add("10n", "weather_showers_scattered");
+            images.Add("11d", "weather_storm");
+            images.Add("11n", "weather_storm");
+            images.Add("13d", "weather_snow");
+            images.Add("13n", "weather_snow");
+            images.Add("50d", "weather_fog");
+            images.Add("50n", "weather_fog");
+        }
+
+        public static string GetTransaltedImage(string id)
+        {
+            string value;
+            images.TryGetValue(id, out value);
+
+            return value;
+        }
+    }
+}
index 94aff21..d05d572 100644 (file)
@@ -232,7 +232,7 @@ namespace WeatherInformation.Resources {
         }
         
         /// <summary>
-        ///   Busca una cadena traducida similar a SUN RISE.
+        ///   Busca una cadena traducida similar a SUN RISE (UTC).
         /// </summary>
         public static string MainPageCurrentSunRise {
             get {
@@ -241,7 +241,7 @@ namespace WeatherInformation.Resources {
         }
         
         /// <summary>
-        ///   Busca una cadena traducida similar a SUN SET.
+        ///   Busca una cadena traducida similar a SUN SET (UTC).
         /// </summary>
         public static string MainPageCurrentSunSet {
             get {
index fdb107b..4841556 100644 (file)
     <value>VIENTO</value>
   </data>
   <data name="MainPageCurrentSunSet" xml:space="preserve">
-    <value>SOL SE PONE</value>
+    <value>SOL SE PONE (UTC)</value>
   </data>
   <data name="MainPageCurrentSunRise" xml:space="preserve">
-    <value>SOL SALE</value>
+    <value>SOL SALE (UTC)</value>
   </data>
   <data name="MainPageCurrentSnow" xml:space="preserve">
     <value>NIEVE</value>
index d281cf9..5325aac 100644 (file)
           <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>
+          <source>SUN SET (UTC)</source>
+          <target state="translated">SOL SE PONE (UTC)</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>
+          <source>SUN RISE (UTC)</source>
+          <target state="translated">SOL SALE (UTC)</target></trans-unit>
         <trans-unit id="Resx/MainPageCurrentSnow" translate="yes" xml:space="preserve">
           <source>SNOW</source>
           <target state="translated">NIEVE</target>
index d601dde..6106e3e 100644 (file)
           <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>
+          <source>SUN SET (UTC)</source>
+          <target state="new">SUN SET (UTC)</target>
         </trans-unit>
         <trans-unit id="Resx/MainPageCurrentSunRise" translate="yes" xml:space="preserve">
-          <source>SUN RISE</source>
-          <target state="new">SUN RISE</target>
+          <source>SUN RISE (UTC)</source>
+          <target state="new">SUN RISE (UTC)</target>
         </trans-unit>
         <trans-unit id="Resx/MainPageCurrentSnow" translate="yes" xml:space="preserve">
           <source>SNOW</source>
index fb63164..65e2de4 100644 (file)
     <value>SNOW</value>
   </data>
   <data name="MainPageCurrentSunRise" xml:space="preserve">
-    <value>SUN RISE</value>
+    <value>SUN RISE (UTC)</value>
   </data>
   <data name="MainPageCurrentSunSet" xml:space="preserve">
-    <value>SUN SET</value>
+    <value>SUN SET (UTC)</value>
   </data>
   <data name="MainPageCurrentWind" xml:space="preserve">
     <value>WIND</value>
index c53a2ab..6bdfb9e 100644 (file)
@@ -3,6 +3,7 @@
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:vm="clr-namespace:WeatherInformation.ViewModels"
     TitleTextCityCountry="City,country"
+    CurrentWeatherImagePath="/Images/weather_clear.png"
     CurrentMaxTemp="25"
     CurrentMaxTempUnits="ºC"
     CurrentMinTemp="15"
@@ -14,9 +15,9 @@
     CurrentRainText="RAIN"
     CurrentSnow="10"
     CurrentSnowText="SNOW"
-    CurrentSunRiseText="SUN RISE"
+    CurrentSunRiseText="SUN RISE (UTC)"
     CurrentSunRise="2014.07.19 07:01:54"
-    CurrentSunSetText="SUN SET"
+    CurrentSunSetText="SUN SET (UTC)"
     CurrentSunSet="2014.07.19 21:41:40"
     CurrentWind="1.03"
     CurrentWindText="WIND"
     CurrentCloudsUnits="%">
 
     <vm:MainViewModel.ForecastItems>
-        <vm:ItemViewModel LineOne="MON" LineTwo="1" LineThree="15ºC" LineFour="10ºC" LineFive="/Assets/Tiles/IconicTileMediumLarge.png"/>
-        <vm:ItemViewModel LineOne="TUE" LineTwo="2" LineThree="16ºC" LineFour="10ºC" LineFive="/Assets/Tiles/IconicTileMediumLarge.png"/>
-        <vm:ItemViewModel LineOne="WED" LineTwo="3" LineThree="14ºC" LineFour="10ºC" LineFive="/Assets/Tiles/IconicTileMediumLarge.png"/>
-        <vm:ItemViewModel LineOne="THU" LineTwo="4" LineThree="12ºC" LineFour="10ºC" LineFive="/Assets/Tiles/IconicTileMediumLarge.png"/>
-        <vm:ItemViewModel LineOne="FRI" LineTwo="5" LineThree="13ºC" LineFour="10ºC" LineFive="/Assets/Tiles/IconicTileMediumLarge.png"/>
-        <vm:ItemViewModel LineOne="SAT" LineTwo="6" LineThree="20ºC" LineFour="10ºC" LineFive="/Assets/Tiles/IconicTileMediumLarge.png"/>
+        <vm:ItemViewModel LineOne="MON" LineTwo="1" LineThree="15ºC" LineFour="10ºC" LineFive="/Images/weather_clear.png"/>
+        <vm:ItemViewModel LineOne="TUE" LineTwo="2" LineThree="16ºC" LineFour="10ºC" LineFive="/Images/weather_clear_night.png"/>
+        <vm:ItemViewModel LineOne="WED" LineTwo="3" LineThree="14ºC" LineFour="10ºC" LineFive="/Images/weather_few_clouds.png"/>
+        <vm:ItemViewModel LineOne="THU" LineTwo="4" LineThree="12ºC" LineFour="10ºC" LineFive="/Images/weather_few_clouds_night.png"/>
+        <vm:ItemViewModel LineOne="FRI" LineTwo="5" LineThree="13ºC" LineFour="10ºC" LineFive="/Images/weather_fog.png"/>
+        <vm:ItemViewModel LineOne="SAT" LineTwo="6" LineThree="20ºC" LineFour="10ºC" LineFive="/Images/weather_overcast.png"/>
     </vm:MainViewModel.ForecastItems>
-
-    <vm:MainViewModel.CurrentItems>
-        <vm:ItemViewModel LineOne="MON 1" LineTwo="15ºC" LineThree="/Assets/Tiles/IconicTileMediumLarge.png"/>
-        <vm:ItemViewModel LineOne="TUE 2" LineTwo="16ºC" LineThree="/Assets/Tiles/IconicTileMediumLarge.png"/>
-        <vm:ItemViewModel LineOne="WED 3" LineTwo="14ºC" LineThree="/Assets/Tiles/IconicTileMediumLarge.png"/>
-        <vm:ItemViewModel LineOne="THU 4" LineTwo="12ºC" LineThree="/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
index bbc7f3e..bc26817 100644 (file)
@@ -2,6 +2,7 @@
     xmlns:ViewModels="clr-namespace:WeatherInformation.ViewModels"
     TitleTextCityCountry="City,country"
     SelectedDate="July 27"
+    SelectedDateWeatherImagePath="/Images/weather_clear.png"
     SelectedDateRainText="RAIN"
     SelectedDateMaxTempUnits="ºC"
     SelectedDateCloudsText="CLOUDS"
index c0e6f04..37764ae 100644 (file)
@@ -44,7 +44,7 @@
                             <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" />
+                            <Image Source="{Binding SelectedDateWeatherImagePath}" Width="100" Height="100" Margin="12,0" />
                             <StackPanel  Orientation="Vertical" VerticalAlignment="Center">
                                 <StackPanel  Orientation="Horizontal" VerticalAlignment="Center">
                                     <TextBlock Text="{Binding SelectedDateMaxTemp}" TextWrapping="Wrap" Style="{StaticResource PhoneTextLargeStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Margin="2,0"/>
index 1248ddf..f6bf463 100644 (file)
@@ -4,6 +4,7 @@ using System.ComponentModel;
 using System.Globalization;
 using System.IO.IsolatedStorage;
 using WeatherInformation.Model;
+using WeatherInformation.Model.Images;
 using WeatherInformation.Resources;
 
 namespace WeatherInformation.ViewModels
@@ -38,6 +39,7 @@ namespace WeatherInformation.ViewModels
         public ObservableCollection<ItemViewModel> ForecastItems{ get; private set; }
         public ObservableCollection<ItemViewModel> CurrentItems { get; private set; }
         public String TitleTextCityCountry { get; private set; }
+        public String CurrentWeatherImagePath { get; private set; }
         public String CurrentMaxTemp { get; private set; }
         public String CurrentMaxTempUnits { get; private set; }
         public String CurrentMinTemp { get; private set; }
@@ -113,7 +115,7 @@ namespace WeatherInformation.ViewModels
                 
                 foreach (WeatherInformation.Model.ForecastWeatherParser.List item in remoteForecastWeatherData.list)
                 {
-                    DateTime date = unixTime.AddSeconds(item.dt).ToLocalTime();
+                    DateTime date = unixTime.AddSeconds(item.dt);
 
                     // 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
                     // double has no null value)
@@ -125,13 +127,26 @@ namespace WeatherInformation.ViewModels
                     double minTemp = item.temp.min;
                     minTemp = minTemp - tempUnits;
 
+                    string weatherImage;
+                    if (item.weather.Count > 0 &&
+                        item.weather[0].icon != null &&
+                        RemoteImagesTranslation.GetTransaltedImage(item.weather[0].icon) != null)
+                    {
+                        weatherImage = RemoteImagesTranslation.GetTransaltedImage(item.weather[0].icon);
+                    }
+                    else
+                    {
+                        weatherImage = "weather_severe_alert";
+                    }
+                    string weatherImagePath = String.Format(CultureInfo.InvariantCulture, "/Images/{0}.png", weatherImage);
+
                     this.ForecastItems.Add(new ItemViewModel()
                     {
                         LineOne = date.ToString("ddd", CultureInfo.InvariantCulture),
                         LineTwo = date.ToString("dd", CultureInfo.InvariantCulture),
                         LineThree = String.Format(CultureInfo.InvariantCulture, "{0:0.##}", maxTemp) + symbol,
                         LineFour = String.Format(CultureInfo.InvariantCulture, "{0:0.##}", minTemp) + symbol,
-                        LineFive = "/Assets/Tiles/IconicTileMediumLarge.png"
+                        LineFive = weatherImagePath
                     });
 
                     count--;
@@ -148,6 +163,20 @@ namespace WeatherInformation.ViewModels
             var remoteCurrentWeatherData = weatherData.RemoteCurrent;
             if (remoteCurrentWeatherData != null)
             {
+                string weatherImage;
+                if (remoteCurrentWeatherData.weather.Count > 0 &&
+                    remoteCurrentWeatherData.weather[0].icon != null &&
+                    RemoteImagesTranslation.GetTransaltedImage(remoteCurrentWeatherData.weather[0].icon) != null)
+                {
+                    weatherImage = RemoteImagesTranslation.GetTransaltedImage(remoteCurrentWeatherData.weather[0].icon);
+                }
+                else
+                {
+                    weatherImage = "weather_severe_alert";
+                }
+                this.CurrentWeatherImagePath = String.Format(CultureInfo.InvariantCulture, "/Images/{0}.png", weatherImage);
+                NotifyPropertyChanged("CurrentWeatherImagePath");
+
                 var currentMaxTemp = "";
                 if (remoteCurrentWeatherData.main != null)
                 {
@@ -268,13 +297,13 @@ namespace WeatherInformation.ViewModels
                 NotifyPropertyChanged("CurrentPressureText");
 
                 this.CurrentSunRiseText = AppResources.MainPageCurrentSunRise;
-                var sunRiseTime = unixTime.AddSeconds(remoteCurrentWeatherData.sys.sunrise).ToLocalTime();
+                var sunRiseTime = unixTime.AddSeconds(remoteCurrentWeatherData.sys.sunrise);
                 this.CurrentSunRise = sunRiseTime.ToString("MM/dd/yy H:mm:ss", CultureInfo.InvariantCulture);
                 NotifyPropertyChanged("CurrentSunRise");
                 NotifyPropertyChanged("CurrentSunRiseText");
 
                 this.CurrentSunSetText = AppResources.MainPageCurrentSunSet;
-                var sunSetTime = unixTime.AddSeconds(remoteCurrentWeatherData.sys.sunset).ToLocalTime();
+                var sunSetTime = unixTime.AddSeconds(remoteCurrentWeatherData.sys.sunset);
                 this.CurrentSunSet = sunSetTime.ToString("MM/dd/yy H:mm:ss", CultureInfo.InvariantCulture);
                 NotifyPropertyChanged("CurrentSunSet");
                 NotifyPropertyChanged("CurrentSunSetText");
index 2cddabb..cb2e009 100644 (file)
@@ -7,6 +7,7 @@ using System.Runtime.Serialization;
 using System.Text;
 using System.Threading.Tasks;
 using WeatherInformation.Model;
+using WeatherInformation.Model.Images;
 using WeatherInformation.Model.Services;
 using WeatherInformation.Resources;
 
@@ -21,6 +22,7 @@ namespace WeatherInformation.ViewModels
         public String TitleTextCityCountry { get; private set; }
 
         public String SelectedDate { get; private set; }
+        public String SelectedDateWeatherImagePath { get; private set; }
         public String SelectedDateMaxTemp { get; private set; }
         public String SelectedDateMaxTempUnits { get; private set; }
         public String SelectedDateMinTemp { get; private set; }
@@ -69,6 +71,20 @@ namespace WeatherInformation.ViewModels
             double tempUnits = isFahrenheit ? 0 : 273.15;
             string symbol = isFahrenheit ? AppResources.TemperatureUnitsFahrenheitSymbol : AppResources.TemperatureUnitsCentigradeSymbol;
 
+            string weatherImage;
+            if (forecast.weather.Count > 0 &&
+                forecast.weather[0].icon != null &&
+                RemoteImagesTranslation.GetTransaltedImage(forecast.weather[0].icon) != null)
+            {
+                weatherImage = RemoteImagesTranslation.GetTransaltedImage(forecast.weather[0].icon);
+            }
+            else
+            {
+                weatherImage = "weather_severe_alert";
+            }
+            this.SelectedDateWeatherImagePath = String.Format(CultureInfo.InvariantCulture, "/Images/{0}.png", weatherImage);
+            NotifyPropertyChanged("SelectedDateWeatherImagePath");
+
             var selectedDateMaxTemp = "";
             var selectedDateTempUnits = "";
             if (forecast.temp != null)
index 529e604..820d1fe 100644 (file)
     <Compile Include="Model\ForecastWeatherParser\List.cs" />
     <Compile Include="Model\ForecastWeatherParser\Temp.cs" />
     <Compile Include="Model\ForecastWeatherParser\Weather.cs" />
+    <Compile Include="Model\Images\RemoteImagesTranslation.cs" />
     <Compile Include="Model\JsonDataParser\JsonParser.cs" />
     <Compile Include="Model\Location.cs" />
     <Compile Include="Model\LocationDataContext.cs" />
     </Content>
     <Content Include="Images\add.png" />
     <Content Include="Images\feature.settings.png" />
+    <Content Include="Images\weather_clear.png" />
+    <Content Include="Images\weather_clear_night.png" />
+    <Content Include="Images\weather_few_clouds.png" />
+    <Content Include="Images\weather_few_clouds_night.png" />
+    <Content Include="Images\weather_fog.png" />
+    <Content Include="Images\weather_overcast.png" />
+    <Content Include="Images\weather_severe_alert.png" />
+    <Content Include="Images\weather_showers.png" />
+    <Content Include="Images\weather_showers_scattered.png" />
+    <Content Include="Images\weather_snow.png" />
+    <Content Include="Images\weather_storm.png" />
     <Content Include="README_FIRST.txt" />
     <Content Include="Toolkit.Content\ApplicationBar.Add.png" />
     <Content Include="Toolkit.Content\ApplicationBar.Cancel.png" />