System.Windows.Documents Na ...


.NET Framework Class Library
InlineUIContainer Class

An inline-level flow content element which enables UIElement elements (i.e. a Button) to be embedded (hosted) in flow content.

Namespace:  System.Windows.Documents
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Syntax

Visual Basic (Declaration)
<ContentPropertyAttribute("Child")> _
Public Class InlineUIContainer _
    Inherits Inline
Visual Basic (Usage)
Dim instance As InlineUIContainer
C#
[ContentPropertyAttribute("Child")]
public class InlineUIContainer : Inline
Visual C++
[ContentPropertyAttribute(L"Child")]
public ref class InlineUIContainer : public Inline
JScript
public class InlineUIContainer extends Inline
XAML Object Element Usage
<InlineUIContainer>
  Child
</InlineUIContainer>
Remarks

A UIElement element (i.e. a Button) may be embedded directly in flow content by enclosing it in a InlineUIContainer (see example below).

An InlineUIContainer may directly host no more than one UIElement child. However, the child element hosted by an InlineUIContainer may host children of its own.

Examples

The following example shows how to use the InlineUIContainer elements to host UIElement elements within flow content.

XAML
<FlowDocument ColumnWidth="400">
  <Paragraph Background="GhostWhite">
    <Run>
      A UIElement element may be embedded directly in flow content
      by enclosing it in an InlineUIContainer element.
    </Run>
    <LineBreak/>
    <LineBreak/>
    <InlineUIContainer>
      <Button>Click me!</Button>
    </InlineUIContainer>
    <LineBreak/>
    <LineBreak/>
    <Run>
      The InlineUIContainer element may host no more than one top-level
      UIElement.  However, other UIElements may be nested within the
      UIElement contained by an InlineUIContainer element.  For example,
      a StackPanel can be used to host multiple UIElement elements within
      an InlineUIContainer element.
    </Run>
    <InlineUIContainer>
      <StackPanel>
        <Label Foreground="Blue">Choose a value:</Label>
        <ComboBox>
          <ComboBoxItem IsSelected="True">a</ComboBoxItem>
          <ComboBoxItem>b</ComboBoxItem>
          <ComboBoxItem>c</ComboBoxItem>
        </ComboBox>
        <Label Foreground ="Red">Choose a value:</Label>
        <StackPanel>
          <RadioButton>x</RadioButton>
          <RadioButton>y</RadioButton>
          <RadioButton>z</RadioButton>
        </StackPanel>
        <Label>Enter a value:</Label>
        <TextBox>
          A text editor embedded in flow content.
        </TextBox>
      </StackPanel>
    </InlineUIContainer>
  </Paragraph>
</FlowDocument>

The following figure shows how this example renders.

Screenshot: UIElement elements embedded in flow
Inheritance Hierarchy

System..::.Object
  System.Windows.Threading..::.DispatcherObject
    System.Windows..::.DependencyObject
      System.Windows..::.ContentElement
        System.Windows..::.FrameworkContentElement
          System.Windows.Documents..::.TextElement
            System.Windows.Documents..::.Inline
              System.Windows.Documents..::.InlineUIContainer
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5, 3.0
See Also

Reference

Other Resources

Tags :


Page view tracker