PowerToys/Wox/Converters/ImagePathConverter.cs

29 lines
751 B
C#
Raw Normal View History

using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media.Imaging;
2014-07-14 19:03:52 +08:00
using Wox.Helper;
namespace Wox.Converters
{
public class ImagePathConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null || value == DependencyProperty.UnsetValue)
2014-02-28 23:21:01 +08:00
{
return null;
2014-02-28 23:21:01 +08:00
}
2014-12-18 19:22:47 +08:00
return ImageLoader.ImageLoader.Load(value.ToString());
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}