locked
Do actions in OnSuspending Funtcion

    Question

  • hello ,

    i'm trying to do a sequence of actions on OnSuspending function but i can't do it?? can anyone help me

    thanks for advance 

    Monday, April 28, 2014 3:44 PM

Answers

  • In what way is that not working?

    See How to suspend an app for guidance on handling the Suspending event.

    Monday, April 28, 2014 9:44 PM
    Owner
  • Are you using the SuspensionOperation.GetDeferral to tell the system to wait? For example:

    private void OnSuspending(object sender, SuspendingEventArgs e)
    {                             
        var deferral = e.SuspendingOperation.GetDeferral();
    
        // Do something     
    
        deferral.Complete();
    }

    Monday, April 28, 2014 9:51 PM

All replies

  • what sort of sequence and in what way does it not work? You have limited time when suspending, so it's better to save large changes earlier and more often
    Monday, April 28, 2014 4:47 PM
    Owner
  • thanks for answering sir,

    i'll explain to you te situation: i want to retreive the date and the time when te user suspend the application 

    Monday, April 28, 2014 4:55 PM
  • In what way is that not working?

    See How to suspend an app for guidance on handling the Suspending event.

    Monday, April 28, 2014 9:44 PM
    Owner
  • Are you using the SuspensionOperation.GetDeferral to tell the system to wait? For example:

    private void OnSuspending(object sender, SuspendingEventArgs e)
    {                             
        var deferral = e.SuspendingOperation.GetDeferral();
    
        // Do something     
    
        deferral.Complete();
    }

    Monday, April 28, 2014 9:51 PM