I am running RIA services with silverlight 4.
I have RIA services entities, which derive from this class,
System.ServiceModel.DomainServices.Client.Entity
They are being marked as changed (using either the HasChanges field, or the EntityState field) when they are not changed. I need a more reliable way to work out which of my entities have changed.
The reason is that I have three text fields on my entity, a plain text field, rich text field, and an HTML field. They are all linked up to the same text. Displaying them in my editor control has modified the rich text and the HTML fields subtly, but not the plain text field.
So I would like to ideally do something like this,
‘Does the entity have any modified fields other than the HTML or Rich Text fields’
The plain text field will pick up on ‘actual’ changes that the user makes to the text.
There are some non public members on the Entity base class called ‘ModifiedProperties’ and ‘OriginalValues’ which would be ideal if there was a way to use them?
OK, turns out on closer inspection that the rich text control I am using does not support binding. That means in the code there is something like this,
and
I am using a third party control Liquid.RichTextBlock. It turns out that this control returns back a different RichText and HTML in some cases even if the text hasn’t been edited. This can relate to the width of the control which is on a resizable popup.
The Liquid.RichTextBlock control has a property called ‘History’ and I can actually use that property to tell me if the user has actually updated the text.
In principal something like this,