I'm working in windows phone 8 application with MVVM pattern. I need to preserve page state when my app going to suspend. So I'm using State dictionary to store my viewmodel its working fine, But when I try to store viewmodel with parameter wise constructor following error will be occurred.
Type 'ViewModel' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.