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.
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
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