Save to IsolatedStorage on Application_Deactivated

Topics: Getting Started
Nov 6, 2012 at 7:24 PM

On my non-caliburn project I used to save data to isolated storage when the method Application_Deactivated in App.xaml.cs was called

I am now switching to caliburn but I don't get how to use the IPhoneService which I think implements this method.

What is the best way to do this?

Application_Deactivated
Nov 6, 2012 at 9:01 PM

So you have never looked at the examples for Windows Phone... There are some pretty helpful insights how the Bootstrapper is put together.

There is a Configure method that is overridden to get the phoneservices registered, which is part of the Phone container that CM has in it.

 public class Bootstrapper : PhoneBootstrapper
    {
        PhoneContainer container;
        
        protected override void Configure()
        {
            container = new PhoneContainer(RootFrame);

            container.RegisterPhoneServices();

with this you also have access to the Deactiveated, Launch, etc events but you don't have to really do anything in those events unless you really need to.   The container is the IoC container built into the Phone assemblys of CM.

 

Nov 7, 2012 at 2:46 PM

I did look the examples but I didn't realize that those methods are available in the bootstrapper to override. Thank you