diff options
| author | ebr11 Eric Reed spam <ebr11 Eric Reed spam@reedsplace.com> | 2012-09-20 13:54:37 -0400 |
|---|---|---|
| committer | ebr11 Eric Reed spam <ebr11 Eric Reed spam@reedsplace.com> | 2012-09-20 13:54:37 -0400 |
| commit | 7ed11c0bbae55cd2d5c559a2ef6af8f20edebeef (patch) | |
| tree | f96d8d2ba2b3ba71b7b31f012fcdd80ae09f0868 /MediaBrowser.Plugins.DefaultTheme/Converters/WeatherImageConverter.cs | |
| parent | da618f13e23cbef6ca71c8c0099dfd563a394fa5 (diff) | |
| parent | 119dfc3ac70db7536e86191eb3c89ffa1fd4f576 (diff) | |
Merge with default
Diffstat (limited to 'MediaBrowser.Plugins.DefaultTheme/Converters/WeatherImageConverter.cs')
| -rw-r--r-- | MediaBrowser.Plugins.DefaultTheme/Converters/WeatherImageConverter.cs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/MediaBrowser.Plugins.DefaultTheme/Converters/WeatherImageConverter.cs b/MediaBrowser.Plugins.DefaultTheme/Converters/WeatherImageConverter.cs new file mode 100644 index 000000000..0d73a1a6f --- /dev/null +++ b/MediaBrowser.Plugins.DefaultTheme/Converters/WeatherImageConverter.cs @@ -0,0 +1,43 @@ +using MediaBrowser.Model.Weather;
+using System;
+using System.ComponentModel.Composition;
+using System.Globalization;
+using System.Windows.Data;
+
+namespace MediaBrowser.Plugins.DefaultTheme.Converters
+{
+ [PartNotDiscoverable]
+ public class WeatherImageConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ var weather = value as WeatherInfo;
+
+ if (weather != null)
+ {
+ switch (weather.CurrentWeather.Condition)
+ {
+ case WeatherConditions.Thunderstorm:
+ return "../Images/Weather/Thunder.png";
+ case WeatherConditions.Overcast:
+ return "../Images/Weather/Overcast.png";
+ case WeatherConditions.Mist:
+ case WeatherConditions.Sleet:
+ case WeatherConditions.Rain:
+ return "../Images/Weather/Rain.png";
+ case WeatherConditions.Blizzard:
+ case WeatherConditions.Snow:
+ return "../Images/Weather/Snow.png";
+ default:
+ return "../Images/Weather/Sunny.png";
+ }
+ }
+ return null;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
|
