IEditableObject implementations IEditableObject implementations wpf wpf

IEditableObject implementations


In fact, MemberwiseClone applies a shallow copy. If you apply a shallow copy, reference type objects inside your object (like some reference type properties) are not created, just references are copied. So each instance will refer to the same objects.

In deep copy, reference type objects inside the object are also copied.

Think of a list of items; if you apply shallow copy, you will end up with two lists pointing to the same objects. If you apply deep copy, new objects will be created for the new list.

I advise you to go with deep copy, instead of a shallow copy. Think about the list example; if you apply a shallow copy and change any element in the copied list, then it will not be possible to revert all changes back; since copied list shares the same elements with the original list.