SimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbol() { Color = new SolidColorBrush(Colors.Red), Size = 10, Style = SimpleMarkerSymbol.SimpleMarkerStyle.Circle }; using (TextWriter textWriter = new StreamWriter(@"c:\temp\test.xml")) { XmlSerializer xmlSerializer = new XmlSerializer(simpleMarkerSymbol.GetType()); xmlSerializer.Serialize(textWriter, simpleMarkerSymbol); }
Solved! Go to Solution.
Hi,
You cannot serialize Symbols since those contains brushes.
If you know exactly what you are going to serialize, you can manually serialize brushes to data object that contains the initialization information.
I have made long time ago extension to serialize GraphicsLayer. You can read more about from http://forums.arcgis.com/threads/59595-I-need-to-be-able-to-add-a-symbol-to-the-map-and-save-it?p=22...
he code is not near perfect but did the job at that time and it was fun test to work with. If you or other people are interested, I could upload the code to GitHub.
Hi Antti,
I´ve interesting serialize the Graphics into a database, can you upload the code to GitHub.
Thanks Antti,