Inline​UI​Container Inline​UI​Container Inline​UI​Container Class


Provides an inline content element that enables UIElement types to be embedded in the content of a RichTextBlock.

public : sealed class InlineUIContainer : Inline, IInlineUIContainerpublic sealed class InlineUIContainer : Inline, IInlineUIContainerPublic NotInheritable Class InlineUIContainer Inherits Inline Implements IInlineUIContainer
<InlineUIContainer .../>
<InlineUIContainer ...>

Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Inherited Members

Inherited properties

Inherited events

Inherited methods


The following code example shows how you can insert an image into a RichTextBlock by using InlineUIContainer.

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

            <Image Source="Assets/SmallLogo.png" Height="30" Width="30"/>

        Mauris auctor tincidunt auctor.


The most common scenario for using an InlineUIContainer object is to introduce an image into text content. Use a new Image object for the image, as the child content for an InlineUIContainer. Set Height and Width on the image if you don't want it to scale to the natural image size.

If you want more than one element inlined in the same position, consider using a panel as the single InlineUIContainer child and then placing the multiple elements within that panel.

If placed within an InlineUIContainer, a control that can be focused still appears in the top-level tab sequence.

If you want interactive text, consider using a Hyperlink element (a type of Inline ) rather than using InlineUIContainer with a Button or similar within it. See Guidelines for links.

InlineUIContainer inherits properties from the TextElement class. However, most of these properties don't have any visible effect. It's most common to declare a InlineUIContainer object element in XAML without there being any attributes set (except possibly x:Name attribute) with the single child element that you're inlining as content of the InlineUIContainer object element.

Setting properties on InlineUIContainer that otherwise affect the character line height of a text element (such as FontSize, FontFamily ) has no effect on the rendering and appearance. The content dictates its size and the InlineUIContainer sizes to fit it.

If there's further text within the child content (like TextBlock.Text or other text elements within a nested RichTextBlock ) the text element properties of the InlineUIContainer parent won't inherit into the content, they're ignored.


InlineUIContainer() InlineUIContainer() InlineUIContainer()

Initializes a new instance of the InlineUIContainer class.

public : InlineUIContainer()public InlineUIContainer()Public Sub New()


Child Child Child

Gets or sets the UIElement hosted by the InlineUIContainer.

public : UIElement Child { get; set; }public UIElement Child { get; set; }Public ReadWrite Property Child As UIElement
<InlineUIContainer ...>

See Also