locked
Static Object - XML Serializaiton RRS feed

  • Question

  • Hello

    We have a requirement to implement singleton pattern using C# in Silverlight class libraries. The Silverlight class libraries act "data" classes. Each of the static class is bound to a Silverlight form. The static object is hydrated as the user enters values in the form. Since, we have to support offline capability, these classes should be serialized as XML in the Silverlight isolated storage. I understand the static classes cannot be serialized out of the box and would like to know the best possible workaround to support the above scenario. Appreciate your help

    Monday, June 20, 2011 10:39 PM

Answers

  • Hi,

    There is no case you can have instance to static classes. therefore nothing to serialize. static classes cannot be serialized.

    You can make use of singleton class in this case.

     

    Hope this helps you... 


    If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".
    • Marked as answer by arasheed Thursday, June 30, 2011 3:05 PM
    Tuesday, June 21, 2011 8:05 AM