Good morning, the binding with RadDocument and Docx drive me crazy.
When I click in importCommand, fires ImportDocx() correctly and file docx is imported in Rdoc property but in RadRichTextBox don´t display in view. When I clik in keyboard, the aplicacion pause in set.
This is my view model:
private RadDocument rd;
public RadDocument Rdoc
{
get { return rd; }
set {
rd = value;
OnPropertyChanged();
}
}
public void ImportDocx()
{
RadDocument doc = null;
DocxFormatProvider provider = new DocxFormatProvider();
using (Stream
inputStream = File.OpenRead(“Any File.docx"))
{
doc =
provider.Import(inputStream);
}
Rdoc=doc;
}
This is my view (Xaml)
<telerik:DocxDataProvider RichTextBox="{Binding ElementName=radRichTextBox}" Docx="{Binding Path=Rdoc, Mode=TwoWay}"/>
<telerik:RadRichTextBox x:Name="radRichTextBox"/>.......