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.
I believe that in the sample I have already showed you how to bind the Status to the Foreground of the Editor, like you did before. The values are colored in red and green.
I have been looking into your sample and I modified it, so now it works as you want. Basically instead of Field and Converter, I used UnboundField and bound it directly to the value you want to change. Please let me know if this helps you or you need further assistance on this matter.
I am back to same problem. Why I can't edit custom type? I know how to convert to and from string to my custom type. I have attached a different example.