We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Bind to SfRichTextboxAdv

Hi,

Would you have any sample on binding to SfRichTextboxAdv using MVVM? 

Kind Regards
Jennifer

8 Replies

AP Arumuga Perumal S Syncfusion Team March 19, 2015 10:23 AM UTC

Hi Jeniffer,

Thank you for your interest in Syncfusion products.

We have prepared a sample to demonstrate binding SfRichTextBoxAdv content to RTF text using MVVM pattern. The ViewModel class contains RTFString property. Whenever this property gets modified explicitly, the RTF contents will be loaded into SfRichTextBoxAdv control. Also whenever SfRichTextBoxAdv content changed, corresponding RTF text will be updated to RTFString property. Please do find the sample from below link. Try running the sample and let us know if this helps you.

Sample link:
Sample.zip

Please let us know if you have any other questions.

Regards,
Arumuga Perumal S.



AP Arumuga Perumal S Syncfusion Team March 19, 2015 11:05 AM UTC

Hi Jeniffer,

Kindly ignore our previous update.

We have prepared a sample to demonstrate binding SfRichTextBoxAdv content to RTF text using MVVM pattern. The ViewModel class contains RTFString property. Whenever this property gets modified explicitly, the RTF contents will be loaded into SfRichTextBoxAdv control. Also whenever SfRichTextBoxAdv content changed, corresponding RTF text will be updated to RTFString property. Please do find the sample from below link. Try running the sample and let us know if this helps you.

Sample link:
Sample.zip

If this is not your requirement, kindly share us the information describing your requirement so that we will provide you with better solution.

Please let us know if you have any other questions.

Regards,
Arumuga Perumal S.


JE Jen March 20, 2015 09:02 AM UTC

Hi Arumuga,

Thank you for your response and sample.  Unfortunately, the solution doesn't build for me as missing reference for the Syncfusion 8.1 controls for Universal XAML.  There are only individual dlls in the installation folders.

Kind Regards
Jennifer


AP Arumuga Perumal S Syncfusion Team March 20, 2015 09:22 AM UTC

Hi Jeniffer, 

Thank you for your update.

We have modified the sample as per your requirement. Please do the sample from below link.

Please let us know if you have any other questions.

Regards, 
Arumuga Perumal S.

Attachment: RTESample_d62b3446.zip


JE Jen March 20, 2015 10:21 AM UTC

Hi Arumuga,

Thank you for your quick response again.  The sample is working now, just wondering in the SfRichTextBoxAdv control are there properties you can bind to the view model instead of setting it in the code behind because my project uses the caliburn mirco for the mvvm model?

Kind Regards
Jennifer


AP Arumuga Perumal S Syncfusion Team March 23, 2015 01:02 PM UTC


Hi Jeniffer,

Thank you for your update.

We have prepared a sample as per your requirement by binding “Document” property of SfRichTextBoxAdv control to the view model.

The View model contains
1. Documents property (Dictionary<string, Stream>) to map document title with document stream.
2. DocumentTitle property (string) to denote the title of current document loaded in SfRichTextBoxAdv.
3. Document property (DocumentAdv) to denote the current document loaded in SfRichTextBoxAdv.

The View contains:
1. ListView whose ItemSource property is bind to Documents.KeyCollection property and SelectedValue property is bind to DocumentTitle property.
2. SfRichTextBoxAdv whose Document property is bind to Document property of ViewModel.


In the sample, whenever the selected value of list value changes, the current document stream will be updated to the dictionary collection and the selected document will be loaded to the SfRichTextBoxAdv control. Please do find the sample from below link.

Sample Link:
Sample.zip

If this is not your requirement, kindly share us the information regarding the properties you need to bind to the view model, so that we can provide you with better solution.

Please let us know if you have any other questions.

Regards,
Arumuga Perumal S.



JE Jen March 26, 2015 11:05 AM UTC

Hi Arumuga,

Thanks for your reply and sample file which had answered my question.

Kind Regards
Jen







AP Arumuga Perumal S Syncfusion Team March 26, 2015 11:19 AM UTC

Hi Jeniffer,

Thank you for your update.

Please let us know if you require any further assistance. We will be happy to assist you.

Regards,
Arumuga Perumal S.


Loader.
Up arrow icon