This question is locked. New answers and comments are not allowed.
Hi there,
am I right that a DocxDataProvider released with the Q1 '12 package? I'm trying to bind against it from a RadDocument in my VM to the DocxDataProvider in my XAML which looks like this:
But it doesn't work properly. The RichTextBox stays empty.
UPDATE:
I've analyzed the code a bit more. The RadDocument property gets bound before it gets filled. But after it's been filled the "NotifyOfPropertyChange" (Caliburn) it gets bound again. I debugged this. I thought maybe the document itself is empty, but it's not. It contains a section with 20 paragraphs.
UPDATE 2:
I thought the solution is, that I don't bind the actual RadDocument, but rather to the exported RadDocument:
VM:
My XAML looks like this:
am I right that a DocxDataProvider released with the Q1 '12 package? I'm trying to bind against it from a RadDocument in my VM to the DocxDataProvider in my XAML which looks like this:
<telerikDocx:DocxDataProvider Docx="{Binding RadDocument, Mode=TwoWay}" RichTextBox="{Binding ElementName=editor}" x:Name="dataProvider" />But it doesn't work properly. The RichTextBox stays empty.
UPDATE:
I've analyzed the code a bit more. The RadDocument property gets bound before it gets filled. But after it's been filled the "NotifyOfPropertyChange" (Caliburn) it gets bound again. I debugged this. I thought maybe the document itself is empty, but it's not. It contains a section with 20 paragraphs.
UPDATE 2:
I thought the solution is, that I don't bind the actual RadDocument, but rather to the exported RadDocument:
VM:
private RadDocument _myDoc;public RadDocument MyDoc{ get { return _myDoc; } set { _myDoc = value; NotifyOfPropertyChange(() => MyDoc); }}private byte[] _myBytes;public byte[] MyBytes{ get { return new DocxFormatProvider().Export(MyDocument); }}// ctorctor(){ MyDoc = GetDocumentSomehow();}My XAML looks like this:
<telerik:RadRichTextBox IsReadOnly="{Binding IsReadOnly}" x:Name="editor" AllowDrop="True" Drop="editor_Drop" /><telerikDocx:DocxDataProvider Docx="{Binding MyBytes}" RichTextBox="{Binding ElementName=editor}" x:Name="dataProvider" />