Storage Restore - WP7

Topics: Bootstrappers & IoC, Framework Services
Jul 26, 2011 at 1:19 AM
Edited Jul 26, 2011 at 1:20 AM

I am running into a situation where I perform a restore but for some reason nothing is getting saved or it is but not restoring as i state below. I have the bootstrapper setup with the viewmodel in question to be a Singleton.  When I get back to the view from a back button navigation the result is a null object in my repository object.  Which makes no sense since 2 repository classes are instanced in the bootstrapper as well, but I am seeing the restore not actually restoring values.  what would cause the instance from not being restored correctly?  This is just a minor bug I am tracking in my app but sort of stuck.

public override void Configure()
        {
            Id(x => x.ScheduleId);  // int - instanced via the querystring on the mainpageviewmodel only thing restored

            Property(x => x.CurrentSchedule).InAppSettings();  // of type Schedule

            Property(x => x.OutTime).InAppSettings();  //string
            Property(x => x.OffTime).InAppSettings();  //string
            Property(x => x.InTime).InAppSettings();   //string
            Property(x => x.OnTime).InAppSettings();   //string

            Property(x => x.SelectedRole).InAppSettings(); //string
            Property(x => x.SelectedApp).InAppSettings();  //string
            Property(x => x.Landings).InAppSettings();     //int
            Property(x => x.Instrument).InAppSettings();   //int
            Property(x => x.Remarks).InAppSettings();      //string
        }

Snippet of the StorageHandler<ScheduledViewModel> config

This is the lastest drop

Morgan.

Coordinator
Jul 26, 2011 at 3:40 AM

Is there any way you can create a repro and send it to me? Please do it as soon as possible. I'm trying to get v1.2 released before the end of the month and I'd like to get this fix in.

Jul 26, 2011 at 4:19 AM
Edited Jul 26, 2011 at 4:20 AM

Rob,

thanks for the late night reply.  Figured it out and it wasn't a CM issue.  It was a confusion between sterling versions.  It would have helped if I had all the bits for sterling setup correctly when versions changed and there wasn't a MASSIVE note that says default driver is in-memory only.  LOL.   So everytime a restoring occurred, it was trying to restore against a database that was completely empty.  Therefore NULL. 

Works as expected with the IsolatedStorageDriver in place for Sterling.

off to bed... gotta be up at 430

Morgan.

Coordinator
Jul 26, 2011 at 1:24 PM

Thanks for the update!