I have designed some custom controls for displaying math equations and now I want to be able to display math equations in Paragraphs. First I was thinking to embed the control in a Figure, but the problem is that I need to align the control with the surrounding text. The alignment should be at baseline if my custom control has one, or if the control doesn't have a baseline (for example a fraction) the alignment should be at center.
How can I embed baseline alignment information into my custom control I have read about TextEmbeddedObject but I am not sure if this is the way to do it. Any suggestions are appreciated.
Regards,
Valentin Iliescu

Embed baseline alignment information into a custom control
marek_adamczuk
Sorry about this long explanation - I don't have experience with text engines.
Thank you,
Valentin
christian p
Thank you,
Valentin
DLDeveloper
Angelo Caruso
You should be able to use the attached property BaselineOffset (I believe its defined on Inline or InlineUIContainer in the PDC builds). If you attach that property to your element, it will be used when performing baseline alignment.
- filipe fortes
Tomas Martinez
If you want to display the equation inline, you can use the BaselineAlignment property on InlineUIContainer. Here's a quick little sample on PDC bits:
<TextBlock FontSize="20">Hello <InlineUIContainer BaselineAlignment="Top"><Rectangle Width="10" Fill="Blue" Height="10" /></InlineUIContainer> <InlineUIContainer BaselineAlignment="Bottom"><Rectangle Width="10" Fill="Blue" Height="10" /></InlineUIContainer>World!</TextBlock>