extendedExecutionResult

extendedExecutionResult

此处记录了详细信息:https://docs.microsoft.com/en-us/windows/uwp/launch-resume/run-minimized-with-extended-executionI'm planing to start a UWP application that monitor a sensor data for 365 days and save all data to database(Sqlite).I still worry about UWP capability. Please advice me Which should I use (UWP/WPF) ? I want to use better UI, than, I want to use UWP if possible...UWP-Suspending is my worry.With this post, Some people said a way to prevent a UWP application from suspending..var extendedExecutionSession = new ExtendedExecutionSession();extendedExecutionSession.Reason = ExtendedExecutionReason.Unspecified;var extendedExecutionResult = await extendedExecutionSession.RequestExtensionAsync();if (extendedExecutionResult != ExtendedExecutionResult.Allowed){//extended execution session revoked extendedExecutionSession.Dispose(); extendedExecutionSession = null;}QuestionIf I wrote this code in UWP app, Can I use a UWP application like Desktop WPF application ? I want to run my UWP application for 365 days without stopping.. even if user do "minimized" on desktop... Please advice it... 解决方案 Yes, you can do that with ExtendedExecution. One thing to note is when you run on battery (e.g. laptop, tablet) you will get suspended after some time - however you can prevent that as well by going into the Battery settings page and set your app as "Always Allowed".Details are documented here: https://docs.microsoft.com/en-us/windows/uwp/launch-resume/run-minimized-with-extended-execution 这篇关于extendedExecutionSession :我们可以像桌面应用程序一样运行 UWP 而不挂起吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-12 00:49