dineshwins
asked on
Object Cloning using MVVMLight
We want to create a copy of the object being edited before making any changes to the objects. We are using MVVMLight with WPF. Kindly suggest some approaches to implement object cloning using MVVMLight.
ASKER
@ged325: I assume the above will create a shallow copy whereas I require the Deep Copy of the object being edited so that at any stage user can revert back to the original values.
then instead of backup use clone.
backup = theobject.Clone()
theobject = backup.Clone()
http://silverlightarvind.blogspot.com/2010/05/c-shallow-copy-vs-deep-copy.html
backup = theobject.Clone()
theobject = backup.Clone()
http://silverlightarvind.blogspot.com/2010/05/c-shallow-copy-vs-deep-copy.html
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nobody was able to provide me with the required solution. I did my RnD & found a solution to the problem.
Dim backup as MyService.MyObject
Dim theObject as MyService.MyObject
Sub cmdEdit_Click
backup = theobject
edit = true
end sub
Sub RollBack
theobject = backup
end sub