Inserting-a-UI-Element in WPF RichTextBoxAdv (Classic)

4 May 20211 minute to read

In order to insert a UI element in the document, ParagraphAdv provides an inline called UIContainerAdv.


Property Description Type Data Type
Height Specifies the height of the image. Dependency Property Double
Width Specifies the width of the image. Dependency Property Double
UIElement Specifies the UI element to be added. Dependency Property UIElement
FitToContent Fits the UIElement based on the size of a page. Dependency Property Boolean

Adding UIElement to an Application

UIContainerAdv can be used to add a UI element directly to an application by using the following code snippet:

 <syncfusion:RichTextBoxAdv Height="300" Width="400" x:Name="richtext">           
 <syncfusion:ParagraphAdv >                       
 <syncfusion:UIContainerAdv >                            
 <Button />                       
RichTextBoxAdv richtext = new RichTextBoxAdv();           
DocumentAdv document = new DocumentAdv();           
SectionAdv section = new SectionAdv();          
 ParagraphAdv paragraph = new ParagraphAdv();           
 UIContainerAdv uicontainer = new UIContainerAdv();           
 uicontainer.UIElement = new Button();           
 richtext.Document = document;


Cut, copy, and paste operations are not permitted for the UIElement.