This is a migrated thread and some comments may be shown as answers.

Issue with InlineUIContainer within RichTextBox

2 Answers 99 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Alois
Top achievements
Rank 1
Alois asked on 04 Jul 2011, 07:43 AM
Hi,

I use a RichTextBox with RibbonUI, in which I added a new RibbonButton with a command to add a InlineUIContainer at the current text position. The InlineUIContainer is filled with a RadMediaPlayer.
RadMediaItem rmi = new RadMediaItem();
rmi.Source = new Uri(Application.Current.Host.Source, "../Resources/Videos/Wildlife.wmv");
RadMediaPlayer rmp = new RadMediaPlayer();
rmp.Items.Add (rmi);
Telerik.Windows.Documents.Model.InlineUIContainer container = new Telerik.Windows.Documents.Model.InlineUIContainer()
container.UiElement = rmp;
if (size != Size.Empty)
{
    container.Height = size.Height;
    container.Width = size.Width;
}

After filling the InlineContainer the command inserts it into the RichTextBox document using an "InsertInline(container)" call.
This works fine and I get the MediaPlayer at the destined position within the document.
If I now save the documents content - close and reopen the RichTextBox - the document stays empty (because of an error when loading the document data (XAMLFormatProvider)).
The reason for that is, that the RichTextBox "automatically" has added a Canvas.Top and Canvas.Left assignment within the RichTextBox xaml line in the InlineContainer paragraph:
<telerik:RadMediaPlayer Clip=... Canvas.Left="2" Canvas.Top="70,7242660522461">
If I manually delete this Canvas assignments in the xaml code the document gets loaded and the RichTextBox workes fine again.

Can one help me?

Kind Regards
Alois

2 Answers, 1 is accepted

Sort by
0
Ivailo Karamanolev
Telerik team
answered on 04 Jul 2011, 03:47 PM
Hi Alois,

I did some testing and it seems that the problem is with the Position property of RadMediaPlayer. The issue has been reported before and you can find an explanation and a possible workaround in this forum thread. There is also a PITS issue, which you can use to track our progress on the issue and increase its priority.

Kind regards,
Ivailo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Alois
Top achievements
Rank 1
answered on 05 Jul 2011, 04:16 PM
Hi Ivailo,

I'm now using the workaround you mentioned.
Just a hint: In my case I have to delete the Canvas.Left and Canvas.Top properties within the document to be successful. There is no Position property in the document to be cleared.

Thank you for your help!

Kind regards
Alois
Tags
RichTextBox
Asked by
Alois
Top achievements
Rank 1
Answers by
Ivailo Karamanolev
Telerik team
Alois
Top achievements
Rank 1
Share this question
or