Hi,
I have custom type implemented which has data and some presentation state information encapsulated.
For the field binding I am using EditorStyle to set the editor to XamTextEditor. In the EditorStyle I have setup a ValueToTextConverter / ValueToDisplayTextConverter for converting back and forth to custom data type. I am also binding the Foreground (presentation) property using Converter.
On the display side its working as expected. However, I am not able to edit the field.
I have created and attached a prototype for reference.
Hello,
Thank you for your post. I have been looking into it and the sample you have provided and I modified it, so now it works as you want. Basically instead of a Field I used an UnboundField to show the custom object’s Property and be able to edit it, because if you use a Field the value remains object you are not able to Edit it. By using ValueToDisplayConverter you only change the Text of the Cell, but not its Value. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Thanks for the updated sample. The editing problem is resolved.
However I am trying to understand the approach I should follow. In the actual application there will be many such fields where I want to update view properties. In the ViewModel, should I model each of these properties with Data+Presentation or should separate properties xxxData, xxxPresentation.
If I take the second approach, how do I bind xxxPresentation.State property to the Cell Foreground like in the current example.