public void SaveState(ISerializerStorage storage, ISerializerStream stream) { stream.DeepSerialize = true; stream.TypeResolver = this; // Serialize The View Models stream.SerializeArray("ViewModels", PersistantViewModels); // Clear the references so view-models and view of the same identifier don't match up stream.ReferenceObjects.Clear(); // Serialize the views stream.SerializeArray("Views", PersistantViews); // Serialize the stream storage.Save(stream); }
/// <summary> /// Saves /// </summary> /// <param name="storage"></param> /// <param name="stream"></param> /// <param name="viewModels"></param> public void Save(ISerializerStorage storage, ISerializerStream stream, IEnumerable <ViewModel> viewModels = null) { stream.SerializeArray("ViewModels", viewModels ?? PersitantViewModels.Values); storage.Save(stream); }