2014-02-19 14:50:15 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Globalization;
|
2014-07-16 10:52:00 +00:00
|
|
|
using System.Windows;
|
2014-02-19 14:50:15 +00:00
|
|
|
using System.Windows.Data;
|
|
|
|
|
|
2014-05-24 08:06:09 +00:00
|
|
|
namespace Wox.Converters
|
2014-02-19 14:50:15 +00:00
|
|
|
{
|
2014-07-16 10:52:00 +00:00
|
|
|
public class ImagePathConverter : IValueConverter
|
2014-02-19 14:50:15 +00:00
|
|
|
{
|
2014-07-16 10:52:00 +00:00
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
2014-02-19 14:50:15 +00:00
|
|
|
{
|
2014-07-16 12:17:51 +00:00
|
|
|
if (value == null || value == DependencyProperty.UnsetValue)
|
2014-02-28 15:21:01 +00:00
|
|
|
{
|
2014-07-16 12:17:51 +00:00
|
|
|
return null;
|
2014-02-28 15:21:01 +00:00
|
|
|
}
|
2014-07-16 10:52:00 +00:00
|
|
|
|
2014-12-18 11:22:47 +00:00
|
|
|
return ImageLoader.ImageLoader.Load(value.ToString());
|
2014-02-19 14:50:15 +00:00
|
|
|
}
|
|
|
|
|
|
2014-07-16 10:52:00 +00:00
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
2014-02-19 14:50:15 +00:00
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|