
Hello,
I can't seem to get a custom image to appear in the HtmlContentProvider.
public class CustomHtmlContentProvider : HtmlContentProvider
{
private readonly Model _model;
public CustomHtmlContentProvider(Model model, string html)
: base(html)
{
_model = model;
}
protected override Image GetImage(string source)
{
if (source.StartsWith("resource:"))
{
BitmapImage bitmapImage = new BitmapImage();
switch (source)
{
case "resource:statement":
bitmapImage = new BitmapImage(_model.GraphicStatementUri);
break;
}
var image = new Image
{
Source = bitmapImage,
Height = 16,
Width = 16
};
//image.Stretch = Stretch.Uniform;
//image.VerticalAlignment = VerticalAlignment.Center;
//image.HorizontalAlignment = HorizontalAlignment.Center;
return image;
}
return base.GetImage(source);
}
}
The GetContent will hit this code, but the image is not displayed. Do you have an example of using a custom image in the quick info tip?