You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
606 B

using System.Globalization;
namespace App.Converters
{
public class Base64ToImage : IValueConverter
{
public Base64ToImage()
{
}
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var bytes = System.Convert.FromBase64String(value as string);
return ImageSource.FromStream(() => new MemoryStream(bytes));
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}