WPF richtexbox inlineuicontainer disappears when moving

392 Views Asked by At

In my WPF application, I have a RichTextBox. I can add a simple control such as TextBlock using this code:

TextPointer tp = myRichTextBox.CaretPosition.GetInsertionPosition(LogicalDirection.Forward);
InlineUIContainer myInlineUIContainer = new InlineUIContainer(myTextBlock, tp);

My problem comes when I try to move the same control around the RichTextBox. It just simply disappears leaving only a space char. I have the AllowDrop and IsDocumentEnabled properties set to true. I've searched all over the web and couldn't find a clear explanation as to why this happens. Could anyone explain and help me to solve this issue??

Thanks

0

There are 0 best solutions below