31 lines
803 B
C#
31 lines
803 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Data;
|
|
using Plume.Icons;
|
|
|
|
namespace JD.Shotgun.WPF.Views.Converters
|
|
{
|
|
public class IconToImageSourceConverter : IValueConverter
|
|
{
|
|
/// <inheritdoc />
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (value is Icon icon)
|
|
{
|
|
return icon.ToImageSource(16, 16);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|