16 lines
508 B
C#
16 lines
508 B
C#
using System.Globalization;
|
|
using Phonebook.Utils;
|
|
|
|
namespace Phonebook.Converters;
|
|
|
|
public class Base64ToPhoto : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (value is not string base64) return null;
|
|
return ImageHelper.Base64ToStreamImageSource(base64);
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
=> throw new NotImplementedException();
|
|
} |