As the subject title says...
I have a XamTextEditor control on my XBAP GUI, and I set its IsAlwaysInEditMode property to true. However, when I click in the box, change the value (thus updating Text and Value properties) and then click away (so that it loses focus), the OriginalValue property updates to be the same as the Text and Value properties.
I thought that if IsAlwaysInEditMode is set to true, OriginalValue doesn't get updated until EndEditMode() is called.
If I am wrong, how can I get this behaviour, so that I can keep track of the original value until such time that the newly-entered value is accepted (by way of another button on the form being pressed)?
The OriginalValue will be updated whenever the element gets logical keyboard focus (e.g. you move keyboard focus from another element to the editor) and it is also updated when the value changes while the editor is not in edit mode or if its always in edit mode and it doesn't have the logical keyboard focus. This keeps the behavior consistent regardless of the IsAlwaysInEditMode setting. If you need to maintain a value separate from that behavior then you will likely need to track the value at the points where you need the value to be stored. You can also submit a suggestion for an additional property to be added that controls when the original value is initialized.
There's no mention of this behaviour at the following link for ValueEditor.OriginalValue:
http://help.infragistics.com/Help/NetAdvantage/WPF/2008.2/CLR3.X/html/Infragistics3.Wpf.Editors.v8.2~Infragistics.Windows.Editors.ValueEditor~OriginalValue.html
...or am I missing it?
From what I understand already, IsAlwaysInEditMode being set to 'true' should mean the control remains in edit mode when it loses focus.
According to the above link, the OriginalValue property should only be updated when the control exits edit mode. In my case, I'm setting IsAlwaysInEditMode to 'true', thus the control should not exit edit mode when it loses focus, yet OriginalValue is being reset to the value of the Value property when the control loses focus.
I think the documented behaviour is better. The relationship between IsAlwaysInEditMode property, OriginalValue property and EndEditMode() function is fairly useless if OriginalValue property always resets when logical keyboard focus is lost.
It is true that the documentation mentions being in edit mode so there is a discrepancy between the documentation and the behavior. It is my understanding that the documentation is incorrect in this case but I would recommend submitting the issue to the support group so that can be determined.