How can I stop Silverlight DataForm immediately saving changes back to underlying object?
Posted
by Simon_Weaver
on Stack Overflow
See other posts from Stack Overflow
or by Simon_Weaver
Published on 2010-05-13T00:56:06Z
Indexed on
2010/05/13
1:04 UTC
Read the original article
Hit count: 503
I have a Silverlight master-details DataForm
where the DataForm represents a street address.
When I edit the Address1
textbox, the value gets automatically committed to the bound Address
object once focus leaves the textbox.
If I hit the Cancel
button, then any changes are undone because Address
implements IEditableObject
and saves its state.
The problem is that since any change is immediately propagated to the underlying object it will be shown in the master grid before the user has actually hit Save
. I also have other locations where this data is shown. This is not a very good user experience.
I've tried OneWay
binding but then I can't commit back without manually copying all the fields over.
The only thing I can think of doing is to create a copy of the data first or using OneWay
binding, but they both seem a little clumsy.
Does DataForm
support this way of working?
© Stack Overflow or respective owner