I need to serialize a custom control, which is divided into Control.xaml and ControlModel.cs (of course the XAML contains just the view and it's bound to the ControlModel which has the properties).
The ControlModel contains a List<CustomControl> where CustomControl can be any of a set of custom controls that I built (each custom control extends this CustomControl class used in the list).
So, serializing the control will require me to serialize this list, and here's the problem:
provided that each CustomControl is built using a XAML file and a model (which is defined as a static resource into the XAML), what's the best way to serialize all those components?
I'm finding it hard because I don't know how to work with both XAML and model.
I mean, I know that I need to serialize just the model, as serializing a view makes no sense, but how can I then deserialize the model and assign it to the view again?
And how can I just serialize the model if I'm serializing a list which contains the UserControl childs?
Keep in mind that those custom controls have simple properties (the most complex property used is just a Color).