Я не понял проблему, но, возможно, вы можете попробовать что-то вроде этого: (это пример)
XAML
положить это в PhoneApplicationPage:
xmlns:my="clr-namespace:YOURNAMESPACE"
<phone:PhoneApplicationPage.Resources>
<my:BinaryToImageSourceConverter x:Key="BinaryToImageSourceConverter1" />
</phone:PhoneApplicationPage.Resources>
Поместите это в сетке:
<Image Source="{Binding Path=Image, Converter={StaticResource BinaryToImageSourceConverter1}, ConverterParameter=Image, TargetNullValue='/Image/no-foto-60.png'}" Stretch="None" />
вы должны реализовать класс BinaryToImageSourceConverter: IValueConverter
namespace YOURNAMESPACE
{
public class BinaryToImageSourceConverter: IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value != null && value is byte[])
{
try
{
var bytes = value as byte[];
var stream = new MemoryStream(bytes);
var image = new BitmapImage();
image.SetSource(stream);
stream.Close();
return image;
}
catch (Exception)
{ }
}
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}