mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
Refactoring icon, part 1, rename
This commit is contained in:
26
Wox.Infrastructure/Image/ImagePathConverter.cs
Normal file
26
Wox.Infrastructure/Image/ImagePathConverter.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user