I'm making an app where the order and properties of the views on a page can be changed. I'm trying to serialize the StackLayout that contains the views.
I've tried 3 different serialization techniques, all of which have failed with the following exceptions:
XmlSerializer:
System.InvalidOperationException: There was an error reflecting type 'AppProject.MyApp'. occurred
Newtonsoft.Json:
Newtonsoft.Json.JsonSerializationException: Self referencing loop detected for property 'ParentView' with type 'Xamarin.Forms.StackLayout'. Path 'Pages[0].stack.Children[0]'.
BinaryFormatter:
System.Runtime.Serialization.SerializationException: Type 'AppProject.MyApp' in Assembly 'AppProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.
Can someone please recommend a solution?
Thanks.