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.
Unfortunately, activation email could not send to your email. Please try again.

RichTextBox MVVM

Thread ID:

Created:

Updated:

Platform:

Replies:

110047 Jul 17,2013 03:08 AM Apr 10,2015 07:23 AM WPF 5
loading
Tags: RichTextBoxAdv
JEAN MICHEL CAMIZON
Asked On July 17, 2013 03:08 AM

Hello,

Is that possible to use th RichTextBoxAdv in a MVVM way ? I mean, I don't want to use code behind to set/get the text inside my RichTextBox I just want to bind to one of his properties.

I tried binding to Document and XAMLText without any success, I looked into the sample but i uses code behind and I don't want that since all my application uses MVVM.

I also found a RichTextBoxAdv.MVVM.WPF lib but I couldn't make it works.

Is there a way to do this in MVVM or do I need to use code behind ?

Gunasekaran T [Syncfusion]
Replied On July 19, 2013 07:09 AM

Hi Jean,

Thank you for your interest in Syncfusion products.

Currently RichTextBoxAdv control does not support binding of XAMLText property directly in Xaml, as a workaround you can achieve this requirement by defining a MVVM extension. We have prepared the WPF sample to illustrate the same to bind the XAMLText property of RichTextBoxAdv control using MVVM framework. Please do find the sample for the same from attachment.

Note: Kindly note that the XAMLText property will not be updated dynamically on content modifications done in RichTextBoxAdv, rather it will be updated only on accessing the XAMLText property (In Getter method). Hence we have used LayoutUpdated event, to get the content modifications done by the user in RichTextBoxAdv control and update the XAMLText to XAMLContent of view model.

Please let us know if you have any other questions.

Regards,
Gunasekaran



Sample_e7f87df0.zip

JEAN MICHEL CAMIZON
Replied On July 25, 2013 04:53 AM

Thank you very much, this works great.

Regards,
Jean Michel

Gunasekaran T [Syncfusion]
Replied On July 25, 2013 08:36 AM

Hi Jean,

Thank you for your update. Please let us know if you require any further assistance.

Regards,
Gunasekaran


Chris
Replied On April 9, 2015 11:14 AM

Hi Jean,

Thank you for your interest in Syncfusion products.

Currently RichTextBoxAdv control does not support binding of XAMLText property directly in Xaml, as a workaround you can achieve this requirement by defining a MVVM extension. We have prepared the WPF sample to illustrate the same to bind the XAMLText property of RichTextBoxAdv control using MVVM framework. Please do find the sample for the same from attachment.

Note: Kindly note that the XAMLText property will not be updated dynamically on content modifications done in RichTextBoxAdv, rather it will be updated only on accessing the XAMLText property (In Getter method). Hence we have used LayoutUpdated event, to get the content modifications done by the user in RichTextBoxAdv control and update the XAMLText to XAMLContent of view model.

Please let us know if you have any other questions.

Regards,
Gunasekaran



Sample_e7f87df0.zip

Hello,

Thansk for support. I can't download the sample, could please make it avalaible ?


Thanks


Narendran Srinivasan [Syncfusion]
Replied On April 10, 2015 07:23 AM

Hi Jean

Thanks for your update

We have prepared the WPF sample to illustrate the same to bind the XAMLText property of RichTextBoxAdv control using MVVM framework. Please do find the sample for the same from attachment.

Sample Link
Sample

Please let me know if you have any other questions.

Regards,
Narendran



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;