Hmmm, I ran into an obstacle.
In the GraphicsLayerExtension.cs file, I tried to convert the following function:
public static void SerializeGraphics(this GraphicsLayer graphicsLayer, XmlWriter writer)
{
XMLSerialize(writer, new SerializableGraphicCollection(graphicsLayer.Graphics));
}
into the following function:
public static void SerializeGraphic(this Graphic graphic, XmlWriter writer)
{
XMLSerialize(writer, new SerializableGraphicCollection(graphic.Graphics()));
}
But that doesn't work because the Graphic class does not have a Graphics property the way the GraphicsLayer class has a Graphics property.
I tried using a graphic.Geometry property, but that doesn't work because SerializableGraphicCollection() accepts a GraphicsLayer object, not a Graphic object.
So, I'm going to try to tweak the SerializableGraphicCollection() method in the DataContracts.cs file to accept a Graphic object in the constructor.