mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-15 03:59:15 +08:00
25 lines
654 B
C#
25 lines
654 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 ImageLoader.ImageLoader.Load(value.ToString());
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
} |