Since windows phone does not have the System.Runtime.Serialization.Formatters.Binary namespace, i am using the following way:
bool[][] newMask = (bool[][])this.mask.Clone();
But i am not sure whether this will make a deep copy or not (although this question suggests that i will make a deep copy but my suspicion lies on the fact that i am using a jagged array for performance purpose)
That only makes a shallow copy. To make a deep copy, you'd want something like:
bool[][] newMask = new bool[mask.Length][];
for (int i = 0; i < newMask.Length; i++)
{
newMask[i] = (bool[]) mask[i].Clone();
}
From the docs for Array.Clone
:
Creates a shallow copy of the Array.
...
A shallow copy of an Array copies only the elements of the Array, whether they are reference types or value types, but it does not copy the objects that the references refer to. The references in the new Array point to the same objects that the references in the original Array point to.
See more on this question at Stackoverflow