.NET
3
Вклад в тег
var uri = value as string;
if (string.IsNullOrWhiteSpace(uri))
return null;
var image = new BitmapImage();
image.BeginInit();
image.UriSource = new Uri(uri);
if (Width != null)
image.DecodePixelWidth = (int)Width;
if (Height != null)
image.DecodePixelHeight = (int)Height;
image.EndInit();
return image;
var uri = value as string;
if (string.IsNullOrWhiteSpace(uri))
return null;
var source = new BitmapImage(new Uri(uri));
var image = new Image { Source = source };
if (Width != null)
image.Width = (int)Width;
if (Height != null)
image.Height = (int)Height;
return image;