Any thoughts?
Regards,
Rick
xmlns:local="clr-namespace:Digital_Kitchen_CdrPrint"
<local:ImageConverter x:Key="ImageConverter" />
<Image x:Name="listImg" Source="{Binding XPath=EmpImage, Converter={StaticResource ImageConverter}}" Stretch="Uniform"/>
public class ImageConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter,
CultureInfo culture)
{
String xml =
"<Tables>" + "<Table>" + ((XmlElement)value).InnerXml.ToString() + "</Table>" + "</Tables>";
XmlDocument XDoc =
new XmlDocument();
XDoc.LoadXml(xml);
// XmlNodeList oXmlNode = XDoc.GetElementsByTagName("Station");
//XmlNode node = XDoc.SelectSingleNode("RecipeName");
XmlNode oXnode = XDoc.SelectSingleNode(
"Tables/Table/EmpImage");
value = oXnode.LastChild.Value;
BitmapImage image =
new BitmapImage();
if (value != null)
{
try
{
image.BeginInit();
image.CacheOption = BitmapCacheOption.OnLoad;
image.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
image.UriSource =
new Uri((string)value, UriKind.Absolute);
image.EndInit();
}
catch
{
image =
null;
}
}
return image;
}
public object ConvertBack(object value, Type targetType, object parameter,
CultureInfo culture)
{
throw new Exception("The method or operation is not implemented.");
}
}