Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1540
OriginalValue being updated when lost focus even when IsAlwaysInEditMode = true
posted

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)?

 

Parents
No Data
Reply
  • 54937
    Offline posted

    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.

Children