InlineUIContainer.Child Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets or sets the UIElement hosted by the InlineUIContainer.
Assembly: System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.
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.
The following code example shows how you can insert an image into a RichTextBox by using the Child property.
'Insert an image into the RichTextBox Private Sub btnImage_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) Dim container As InlineUIContainer = New InlineUIContainer container.Child = MainPage.createImageFromUri(New Uri("/RichNotepad;component/images/Desert.jpg", UriKind.RelativeOrAbsolute), 200, 150) rtb.Selection.Insert(container) 'ReturnFocus() End Sub Private Shared Function createImageFromUri(ByVal URI As Uri, ByVal width As Double, ByVal height As Double) As Image Dim img As Image = New Image img.Stretch = Stretch.Uniform img.Width = width img.Height = height Dim bi As BitmapImage = New BitmapImage(URI) img.Source = bi img.Tag = bi.UriSource.ToString Return img End Function
Show: