I have looked at a few threads discussing passing navigation objects between view models in MvvmCross, (e.g. here and here), and I wonder why MvvmCross doesn't have built-int support for serialization of complex types.
Let me clarify. If I have a navigation objects that consist of a CustomerName (string) and RecentPurchases (List) where Purchase type is a class with a few primitive type properties, then when I pass this navigation object to ShowViewModel, on the receiving side I will get a correct CustomerName and null for RecentPurchases. List is not recognized by MvvmCross as being simple enough for the serialization. This can easily be fixed by replacing RecentPurchases with SerializedRecentPurchases and assigning its value like this:
SerializedRecentPurchases = Mvx.Resolve<IMvxJsonConverter>()
.SerializeObject(RecentPurchases);
In a similar manner the string is deserialized in ViewModels' Init method.
It is all very simple, but I am a little puzzled why MvvmCross doesn't attempt to perform serialization saving developers from writing these lines of code again and again. I know we have to be careful about passing large amounts of data with navigation objects, but on the other hand it's quite common that navigation (or persistent state) objects may contain collections of simple complex types, so wouldn't it be more practical if MvvmCross supported this scenario out of the box?