InlineUIContainer InlineUIContainer InlineUIContainer Class

Definition

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

public : sealed class InlineUIContainer : Inline, IInlineUIContainer
public sealed class InlineUIContainer : Inline, IInlineUIContainer
Public NotInheritable Class InlineUIContainer Inherits Inline Implements IInlineUIContainer
<InlineUIContainer .../>
-or-
<InlineUIContainer ...>
  singleChild
</InlineUIContainer>

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

Examples

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

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

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

        Mauris auctor tincidunt auctor.
    </Paragraph>
</RichTextBlock>

Remarks

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.

Constructors

InlineUIContainer() InlineUIContainer() InlineUIContainer()

Initializes a new instance of the InlineUIContainer class.

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

Properties

AccessKey AccessKey AccessKey

Inherited from TextElement

AccessKeyProperty AccessKeyProperty AccessKeyProperty

Inherited from TextElement

AccessKeyScopeOwner AccessKeyScopeOwner AccessKeyScopeOwner

Inherited from TextElement

AccessKeyScopeOwnerProperty AccessKeyScopeOwnerProperty AccessKeyScopeOwnerProperty

Inherited from TextElement

AllowFocusOnInteraction AllowFocusOnInteraction AllowFocusOnInteraction

Inherited from TextElement

AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty

Inherited from TextElement

CharacterSpacing CharacterSpacing CharacterSpacing

Inherited from TextElement

CharacterSpacingProperty CharacterSpacingProperty CharacterSpacingProperty

Inherited from TextElement

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 ...>
  singleChild
</InlineUIContainer>

ContentEnd ContentEnd ContentEnd

Inherited from TextElement

ContentStart ContentStart ContentStart

Inherited from TextElement

Dispatcher Dispatcher Dispatcher

Inherited from DependencyObject

ElementEnd ElementEnd ElementEnd

Inherited from TextElement

ElementStart ElementStart ElementStart

Inherited from TextElement

ExitDisplayModeOnAccessKeyInvoked ExitDisplayModeOnAccessKeyInvoked ExitDisplayModeOnAccessKeyInvoked

Inherited from TextElement

ExitDisplayModeOnAccessKeyInvokedProperty ExitDisplayModeOnAccessKeyInvokedProperty ExitDisplayModeOnAccessKeyInvokedProperty

Inherited from TextElement

FontFamily FontFamily FontFamily

Inherited from TextElement

FontFamilyProperty FontFamilyProperty FontFamilyProperty

Inherited from TextElement

FontSize FontSize FontSize

Inherited from TextElement

FontSizeProperty FontSizeProperty FontSizeProperty

Inherited from TextElement

FontStretch FontStretch FontStretch

Inherited from TextElement

FontStretchProperty FontStretchProperty FontStretchProperty

Inherited from TextElement

FontStyle FontStyle FontStyle

Inherited from TextElement

FontStyleProperty FontStyleProperty FontStyleProperty

Inherited from TextElement

FontWeight FontWeight FontWeight

Inherited from TextElement

FontWeightProperty FontWeightProperty FontWeightProperty

Inherited from TextElement

Foreground Foreground Foreground

Inherited from TextElement

ForegroundProperty ForegroundProperty ForegroundProperty

Inherited from TextElement

IsAccessKeyScope IsAccessKeyScope IsAccessKeyScope

Inherited from TextElement

IsAccessKeyScopeProperty IsAccessKeyScopeProperty IsAccessKeyScopeProperty

Inherited from TextElement

IsTextScaleFactorEnabled IsTextScaleFactorEnabled IsTextScaleFactorEnabled

Inherited from TextElement

IsTextScaleFactorEnabledProperty IsTextScaleFactorEnabledProperty IsTextScaleFactorEnabledProperty

Inherited from TextElement

KeyTipHorizontalOffset KeyTipHorizontalOffset KeyTipHorizontalOffset

Inherited from TextElement

KeyTipHorizontalOffsetProperty KeyTipHorizontalOffsetProperty KeyTipHorizontalOffsetProperty

Inherited from TextElement

KeyTipPlacementMode KeyTipPlacementMode KeyTipPlacementMode

Inherited from TextElement

KeyTipPlacementModeProperty KeyTipPlacementModeProperty KeyTipPlacementModeProperty

Inherited from TextElement

KeyTipVerticalOffset KeyTipVerticalOffset KeyTipVerticalOffset

Inherited from TextElement

KeyTipVerticalOffsetProperty KeyTipVerticalOffsetProperty KeyTipVerticalOffsetProperty

Inherited from TextElement

Language Language Language

Inherited from TextElement

LanguageProperty LanguageProperty LanguageProperty

Inherited from TextElement

Name Name Name

Inherited from TextElement

TextDecorations TextDecorations TextDecorations

Inherited from TextElement

TextDecorationsProperty TextDecorationsProperty TextDecorationsProperty

Inherited from TextElement

Events

AccessKeyDisplayDismissed AccessKeyDisplayDismissed AccessKeyDisplayDismissed

Inherited from TextElement

AccessKeyDisplayRequested AccessKeyDisplayRequested AccessKeyDisplayRequested

Inherited from TextElement

AccessKeyInvoked AccessKeyInvoked AccessKeyInvoked

Inherited from TextElement

Methods

ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty)

Inherited from DependencyObject

FindName(String) FindName(String) FindName(String)

Inherited from TextElement

GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty)

Inherited from DependencyObject

GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty)

Inherited from DependencyObject

OnDisconnectVisualChildren OnDisconnectVisualChildren OnDisconnectVisualChildren

Inherited from TextElement

ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty)

Inherited from DependencyObject

RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback)

Inherited from DependencyObject

SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object)

Inherited from DependencyObject

UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64)

Inherited from DependencyObject

See Also