Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Is it possible to serialize views?

$
0
0

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.


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>