0

is it possible to create a custom inline object like "Run" and "Span" in RichTextBlock? I didn't find any example or samples.

Thank you!

codelab
  • 406
  • 3
  • 14

1 Answers1

0

As I know, you're can not create custom inline element because ITextElement, ITextElementOverrides or IInline are internal interfaces Instead this, you can try to use InlineUIContainer class

<RichTextBlock>
    <Paragraph>
        <Italic>This is an inline image.</Italic>

        <InlineUIContainer>
            <!--your xaml code here-->
        </InlineUIContainer>

        Mauris auctor tincidunt auctor.
    </Paragraph>
</RichTextBlock>
Andrii Krupka
  • 4,276
  • 3
  • 20
  • 41
  • My intention was to create an inline element that can handle background colors. Using InlineUIContainers allow me to create stackpanels with colored background and text but this objects are not selectable by mouse. Do you know a trick how to reach that goal? – codelab May 17 '16 at 08:47