public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var sampleImageName = value.ToString();
try
{
if (File.Exists(sampleImageName))
return BitmapFrame.Create(
new Uri(sampleImageName, UriKind.Absolute),
BitmapCreateOptions.DelayCreation,
BitmapCacheOption.OnLoad);
}
catch (Exception)
{
}
return null;
}