mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-14 11:39:16 +08:00
174c7a776e
1. Add baidu, fix #576, #582 2. Refactoring
25 lines
682 B
C#
25 lines
682 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows;
|
|
using System.Windows.Data;
|
|
|
|
namespace Wox.Infrastructure.Image
|
|
{
|
|
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;
|
|
}
|
|
}
|
|
} |