PowerToys/Wox/Converters/ImagePathConverter.cs
bao-qian 03051a95cf Refactoring image cache
use parallel linq to preload images, should be faster
2016-04-22 01:42:37 +01:00

24 lines
645 B
C#

using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
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;
}
return App.ImageLoader.Load(value.ToString());
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}