PowerToys/Wox.Infrastructure/Image/ImagePathConverter.cs
2016-05-03 21:18:51 +01:00

26 lines
704 B
C#

using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using Wox.Infrastructure.Image;
namespace Wox.Converters
{
public class ImagePathConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null || value == DependencyProperty.UnsetValue)
{
return null;
}
var image = ImageLoader.Load(value.ToString());
return image;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}