I'm dynamically parsing data and adding text as Run, Hyperlinks and images as InlineUIContainer into a Windows Phone 8.0 RichTextBox. Somehow I can't manage that the images vertically align centered with the text.
Images are added like this:
Paragraph paragraph = new Paragraph();
richTextBox.Blocks.Add(paragraph);
var img = new Image
{
Stretch = Stretch.Uniform,
Source = imageSource,
VerticalAlignment = VerticalAlignment.Center,
Height = inlineImageSize,
};
paragraph.Inlines.Add(new InlineUIContainer {Child = img});
And text like that:
Paragraph paragraph = new Paragraph();
richTextBox.Blocks.Add(paragraph);
paragraph.Inlines.Add(new Run { Text = text });
I tried to set a few values for alignment on the RichTextBox as well, but the text is never centered with the images. The text is always bottom aligned.
Any chance getting the inline images vertically centered with the inline text in the WP RichTextBox?