0

I am new to Windows 8 app development and C# and I am stuck on something rather trivial and hence frustrating.

private async void OnSuspending(object sender, SuspendingEventArgs e)
    {
        var deferral = e.SuspendingOperation.GetDeferral();
        //TODO: Save application state and stop any background activity
        await HelloWorld.Common.SuspensionManager.SaveAsync();
        deferral.Complete();
    }

This is a code in the tutorial put up to explain 'saving session data' on Microsoft's website. We are supposed to add 'async' to the signature of the method but when I do so, the async keyword doesn't turn blue and when I add the subsequent line 'await HelloWorld.....' it underlines the dot after HelloWorld and says, '; expected.'

Please help!

Note: I am using Blend for Windows Visual Studio 2013.

Oscar Orcas
  • 117
  • 2
  • 4
  • 17

0 Answers0