【发布时间】:2015-09-02 10:10:22
【问题描述】:
我做了以下事情: 1.启动我的应用程序 2.启动另一个应用程序 3.再次点击我的应用(例如从应用列表中取出)
在第 .3 步,我希望收到消息回调,但我没有。
在文件 App.xaml.cs 中,我添加了 onResuming this 方法
方式:
public App()
{
//this.askToBeOnLockScreen();
this.createRegisterBgTask();
this.InitializeComponent();
this.Suspending += OnSuspending;
this.Resuming += OnResuming;
}
这里我重写了 2 个方法:
private void OnResuming(object sender, object e)
{
Debug.WriteLine("OnResuming ...................");
}
private void OnSuspending(object sender, SuspendingEventArgs e)
{
Debug.WriteLine("onsuspending ......................................................");
var deferral = e.SuspendingOperation.GetDeferral();
deferral.Complete();
}
甚至没有调用 onsuspending。
我做错了什么?
我是 Windows 商店应用的新手
【问题讨论】:
标签: c# windows-store-apps