Objective: Make the text content of InlineUIContainer embedded in external text.
The standard behavior of InlineUIContainer content is when the bottom edge is embedded in the outer text.
You can shift the position of an InlineUIContainer with a RenderTransform, but a value of Y should be chosen for each type and font size - this is not an ideal way.
<RichTextBox>
<Paragraph>
LLL
<InlineUIContainer>
<Border Background="LightGoldenrodYellow">
<TextBlock Text="LLL"/>
</Border>
</InlineUIContainer>
LLL
</Paragraph>
<Paragraph>
LLL
<InlineUIContainer>
<Border Background="LightGoldenrodYellow">
<Border.RenderTransform>
<TranslateTransform Y="5" />
</Border.RenderTransform>
<TextBlock Text="LLL"/>
</Border>
</InlineUIContainer>
LLL
</Paragraph>
</RichTextBox>

How to align text in InlineUIContainer content with external text in RichTextBox regardless of font type and size?
In WPF, the BaselineAlignment = "Center" property works fine .
But Silverlight seems happy with that functionality.
source
share