Windows Phone 8恢复/暂停/激活/停用

时间:2017-08-01 11:12:41

标签: c# windows-phone-8 windows-phone

我目前正在尝试制作一个从服务器获取一些数据的应用。我有一个列表,当我登录一些数据时,我正在填充它。这个想法是数据可以在短时间内改变。我做了一个自动刷新按钮,工作正常,但我想实现这样的事情:

  • 当您打开应用程序时,所有内容都已加载,很好(已完成)。

  • 如果你最小化(放入任务栏,我不知道怎么说,请进入另一个应用程序或菜单)。您的应用将被暂停。当你恢复它时,我希望它执行刷新的事情。 (需要帮助)。

我目前正在使用Windows Phone 8,启动了这个项目,并想完成这个项目。 App.current.没有resumesuspend,我在很多YouTube视频或MSDN网站上找到了activateddeactivated。因此,我认为我应该对this.suspend / this.resume执行某些操作,但我不知道在哪里添加此处理程序。在MSDN网站上我只发现了这个功能。

我正在寻找类似这样的内容:Event on returning to app, after exiting by Windows key [UWP][Win10 Mobile],但正如我所说,我在Windows Phone 8上没有Server_Send Client_recv Client_Send Server_Recv 1: 08-01-2017 12:09:06.516997 1: 08-01-2017 12:09:06.517137 1:08-01-2017 12:09:06.520692 1: 08-01-2017 12:09:06.520776 2: 08-01-2017 12:09:06.526003 2: 08-01-2017 12:09:06.526977 2: 08-01-2017 12:09:06.527227 2: 08-01-2017 12:09:06.527277 3: 08-01-2017 12:09:06.536623 3: 08-01-2017 12:09:06.537347 3:08-01-2017 12:09:06.538064 3: 08-01-2017 12:09:06.538145 4: 08-01-2017 12:09:06.548041 4: 08-01-2017 12:09:06.548244 4:08-01-2017 12:09:06.553930 4: 08-01-2017 12:09:06.553984 5: 08-01-2017 12:09:06.558734 5: 08-01-2017 12:09:06.560445 5:08-01-2017 12:09:06.562220 5: 08-01-2017 12:09:06.562275 6: 08-01-2017 12:09:06.570256 6: 08-01-2017 12:09:06.571268 6:08-01-2017 12:09:06.573355 6: 08-01-2017 12:09:06.573410 7: 08-01-2017 12:09:06.581230 7: 08-01-2017 12:09:06.581581 7: 08-01-2017 12:09:06.583369 7: 08-01-2017 12:09:06.583415 8: 08-01-2017 12:09:06.591663 8: 08-01-2017 12:09:06.592463 8:08-01-2017 12:09:06.593920 8: 08-01-2017 12:09:06.593969 9: 08-01-2017 12:09:06.602883 9: 08-01-2017 12:09:06.603185 9:08-01-2017 12:09:06.605446 9: 08-01-2017 12:09:06.605493 10: 08-01-2017 12:09:06.613645 10: 08-01-2017 12:09:06.613682 10:08-01-2017 12:09:06.616006 10: 08-01-2017 12:09:06.616074 11: 08-01-2017 12:09:06.626245 11: 08-01-2017 12:09:06.626271 11:08-01-2017 12:09:06.626572 11: 08-01-2017 12:09:06.626656 12: 08-01-2017 12:09:06.636939 12: 08-01-2017 12:09:06.637014 12:08-01-2017 12:09:06.639457 12: 08-01-2017 12:09:06.639514 13: 08-01-2017 12:09:06.647869 13: 08-01-2017 12:09:06.647869 13:08-01-2017 12:09:06.648664 13: 08-01-2017 12:09:06.648709 14: 08-01-2017 12:09:06.659493 14: 08-01-2017 12:09:06.659696 14:08-01-2017 12:09:06.660737 14: 08-01-2017 12:09:06.660788 15: 08-01-2017 12:09:06.670809 15: 08-01-2017 12:09:06.671052 15:08-01-2017 12:09:06.674226 15: 08-01-2017 12:09:06.674273 16: 08-01-2017 12:09:06.681847 16: 08-01-2017 12:09:06.681891 16:08-01-2017 12:09:06.682959 16: 08-01-2017 12:09:06.683012 17: 08-01-2017 12:09:06.692172 17: 08-01-2017 12:09:06.692213 17:08-01-2017 12:09:06.693255 17: 08-01-2017 12:09:06.693351 18: 08-01-2017 12:09:06.704028 18: 08-01-2017 12:09:06.704249 18:08-01-2017 12:09:06.705936 18: 08-01-2017 12:09:06.706016 19: 08-01-2017 12:09:06.715104 19: 08-01-2017 12:09:06.721432 19:08-01-2017 12:09:06.721995 19: 08-01-2017 12:09:06.722050 20: 08-01-2017 12:09:06.725430 20: 08-01-2017 12:09:06.732182 20:08-01-2017 12:09:06.735507 NA 21: 08-01-2017 12:09:06.736586 21: 08-01-2017 12:09:06.742824 21:08-01-2017 12:09:06.745176 20: 08-01-2017 12:09:06.736587 22: 08-01-2017 12:09:06.747406 22: 08-01-2017 12:09:06.753496 22:08-01-2017 12:09:06.755014 21: 08-01-2017 12:09:06.747448 23: 08-01-2017 12:09:06.758205 23: 08-01-2017 12:09:06.764413 23:08-01-2017 12:09:06.764537 22: 08-01-2017 12:09:06.758251 / conda update -c conda-forge jpeg

1 个答案:

答案 0 :(得分:0)

如果我们谈论Windows Phone 8,我们必须指定哪种应用程序风格。

  1. 对于Silverlight应用程序,有Application_Activated()和Application_Deactivated()方法,通常它们会自动在App.xaml.cs中自动创建
  2. 对于所谓的" RT应用程序"有事件Suspending和Resuming,第一个在App.xaml.cs中自动订阅(所以只需将你的代码放入自动生成的处理程序中),你必须自己订阅第二个。