public PropertyFinderPersistentState(IStatePersistenceService persistenceService) : this() { _persistenceService = persistenceService; Favourites = new List<Property>(); RecentSearches = new List<RecentSearch>(); }
public PropertyFinderPersistentState(IStatePersistenceService persistenceService) : this() { _persistenceService = persistenceService; Favourites = new List <Property>(); RecentSearches = new List <RecentSearch>(); }
/// <summary> /// Deletes the saved state of the <see cref="WorkItem"/>. The local copy of the state is not changed. /// </summary> /// <exception cref="ServiceMissingException">Thrown if the IStatePersistenceService is not /// registered in the WorkItem.</exception> public void DeleteState() { IStatePersistenceService service = Services.Get <IStatePersistenceService>(); if (service == null) { throw new ServiceMissingException(typeof(IStatePersistenceService), this); } service.Remove(ID); }
/// <summary> /// Saves the state of this work item. /// </summary> public void Save() { IStatePersistenceService service = Services.Get <IStatePersistenceService>(); if (service == null) { throw new ServiceMissingException(typeof(IStatePersistenceService), this); } using (new WriterLock(state.syncRoot)) { service.Save(state); state.AcceptChanges(); } }
/// <summary> /// Loads the work item. /// </summary> public void Load() { IStatePersistenceService service = Services.Get <IStatePersistenceService>(); if (service == null) { throw new ServiceMissingException(typeof(IStatePersistenceService), this); } using (new WriterLock(state.syncRoot)) { State newState = service.Load(ID); newState.syncRoot = ReleaseState(); AttachState(newState); } }
public override void Initialize() { CreatableTypes() .EndingWith("Service") .AsInterfaces() .RegisterAsLazySingleton(); Mvx.RegisterType <PropertyDataSource, PropertyDataSource>(); Mvx.RegisterType <IStatePersistenceService, StatePersistenceService>(); Mvx.RegisterType <IJsonPropertySearch, JsonWebPropertySearch>(); Mvx.RegisterSingleton(() => { IStatePersistenceService state = Mvx.Resolve <IStatePersistenceService>(); return(state.LoadState()); }); RegisterAppStart <ViewModels.PropertyFinderViewModel>(); }
public PropertyFinderPersistentState(IStatePersistenceService persistenceService) : this() { _persistenceService = persistenceService; }
public PropertyFinderPersistentState(IStatePersistenceService persistenceService) : this() { _persistenceService = persistenceService; }
public PropertyCrossPersistentState(IStatePersistenceService persistenceService) : this() { _persistenceService = persistenceService; }
public PropertyCrossPersistentState(IStatePersistenceService persistenceService) : this() { _persistenceService = persistenceService; }