• <tfoot id='LeZY5'></tfoot>

    <legend id='LeZY5'><style id='LeZY5'><dir id='LeZY5'><q id='LeZY5'></q></dir></style></legend>
  • <small id='LeZY5'></small><noframes id='LeZY5'>

    <i id='LeZY5'><tr id='LeZY5'><dt id='LeZY5'><q id='LeZY5'><span id='LeZY5'><b id='LeZY5'><form id='LeZY5'><ins id='LeZY5'></ins><ul id='LeZY5'></ul><sub id='LeZY5'></sub></form><legend id='LeZY5'></legend><bdo id='LeZY5'><pre id='LeZY5'><center id='LeZY5'></center></pre></bdo></b><th id='LeZY5'></th></span></q></dt></tr></i><div id='LeZY5'><tfoot id='LeZY5'></tfoot><dl id='LeZY5'><fieldset id='LeZY5'></fieldset></dl></div>
      <bdo id='LeZY5'></bdo><ul id='LeZY5'></ul>

      1. 我可以为Window Universal App创建一个警报应用程序吗?

        时间:2023-09-15

          <legend id='ELcOX'><style id='ELcOX'><dir id='ELcOX'><q id='ELcOX'></q></dir></style></legend>
            <tbody id='ELcOX'></tbody>
            1. <small id='ELcOX'></small><noframes id='ELcOX'>

                <bdo id='ELcOX'></bdo><ul id='ELcOX'></ul>
                <tfoot id='ELcOX'></tfoot>

                  <i id='ELcOX'><tr id='ELcOX'><dt id='ELcOX'><q id='ELcOX'><span id='ELcOX'><b id='ELcOX'><form id='ELcOX'><ins id='ELcOX'></ins><ul id='ELcOX'></ul><sub id='ELcOX'></sub></form><legend id='ELcOX'></legend><bdo id='ELcOX'><pre id='ELcOX'><center id='ELcOX'></center></pre></bdo></b><th id='ELcOX'></th></span></q></dt></tr></i><div id='ELcOX'><tfoot id='ELcOX'></tfoot><dl id='ELcOX'><fieldset id='ELcOX'></fieldset></dl></div>
                • 本文介绍了我可以为Window Universal App创建一个警报应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想创建一个闹钟应用程序.

                  我找到了在后台操作计时器的方法.但是没有找到控制显示器电源的API(我想在显示器电源关闭时打开显示器的电源).

                  Windows 10(Windows 通用应用)是否没有足够的 API 来创建该应用?

                  解决方案

                  <小时>

                  更新

                  微软最近回复了 我的一个 API 请求,我在此处发布内容,以便大家知道哪些 API 已添加,哪些尚未完成.

                  做了什么

                  1. 现在有一种方法可以在通用窗口中创建警报/提醒应用程序;
                  2. 闹钟/提醒支持自定义贪睡时间(您可以选择让系统处理贪睡,或唤醒你的后台任务来做手动);
                  3. 闹钟/提醒只支持振动(就像吐司一样),可以被用户覆盖以关闭振动;
                  4. 警报/提醒支持良好的可定制性(自定义可选的内嵌图片、自定义附加操作等).

                  一些参考资料

                  • 适用于 Windows 10 的自适应交互式 Toast 通知

                  • 适用于 Windows 10 的 Toast 通知和操作中心概述

                  • 快速入门:发送本地toast通知及处理从中激活(Windows 10)

                  我们 (MSFT) 知道缺少的内容并希望在不久的将来支持

                  1. 本机平台支持警报/提醒,以在时区更改时自动处理时间转换(解决方法 - 这可以由应用程序使用 TimeZoneChange 系统触发器手动完成)
                  2. 本机平台支持重复事件的警报/提醒(解决方法 - 目前只能通过应用手动定期唤醒并提前重新安排一堆警报/提醒来完成);

                  3. 原生平台支持从音乐库中选择一首歌曲作为闹钟/提醒的铃声(解决方法 - 这可以通过从音乐库中读取和复制文件来完成,然后使用保存/修改的您的应用程序包中的文件版本或应用程序数据作为铃声(toast 通知通过指向 xml 有效负载中的 appx 或 appdata 中的文件支持自定义声音)).

                  I would like to create an alarm app.

                  I found the way of operating a timer in the background. But APIs which control the power of the display were not found(I want to turn on the display's power when its power is off).

                  Doesn't Windows 10 (Windows Universal App) have enough APIs to create that app?

                  解决方案

                  Windows-universal-samples has recently been updated with a few new RTM samples including this one - Notifications.

                  As Alarm is also one type of notification, it's now built within a new toast notification framework in the Universal Windows Platform.

                  After you downloaded the source code from the Notification's link above, run it with Visual Studio 2015 RTM and then once the app is loaded, go to

                  toasts > scenarios > scenario: alarm

                  and you will see a fully functional alarm app (along with Reminder and a lot other samples).


                  Let's talk about code.

                  Basically, unlike in Windows Phone Silverlight, you can now customise the alarm popup a bit by specifying the xml payload like this (make sure the scenario is set to alarm)

                  <toast launch='args' scenario='alarm'>
                      <visual>
                          <binding template='ToastGeneric'>
                              <text>Alarm</text>
                              <text>Get up now!!</text>
                          </binding>
                      </visual>
                      <actions>
                  
                          <action arguments = 'snooze'
                                  content = 'snooze' />
                  
                          <action arguments = 'dismiss'
                                  content = 'dismiss' />
                  
                      </actions>
                  </toast>
                  

                  And then create an XmlDocument which loads the above xml string

                  var xmlString = @"//copy above xml here//";
                  var doc = new Windows.Data.Xml.Dom.XmlDocument();
                  doc.LoadXml(xmlString);
                  

                  Then create a ToastNotification and trigger it with ToastNotificationManager-

                  var toast = new ToastNotification(doc);
                  ToastNotificationManager.CreateToastNotifier().Show(toast);
                  

                  That's it! You will see an alarm popup like below.


                  Update

                  Microsoft recently responded to one of my API requests and I am posting the content here so everyone knows what APIs have been added and what are still outstanding.

                  What has been done

                  1. There is now a way to create an alarm/reminder in universal windows apps;
                  2. The alarm/reminder supports custom snooze time (you can choose to let system handle snooze, or wake up your background task to do it manually);
                  3. The alarm/reminder supports vibrate only (just like toast) that can be overwritten by user to turn off vibration;
                  4. The alarm/reminder supports a good level of customizability (custom optional inline image, custom additional actions, etc).

                  Some references

                  • Adaptive and interactive toast notifications for Windows 10

                  • Toast Notification and Action Center Overview for Windows 10

                  • Quickstart: Sending a local toast notification and handling activations from it (Windows 10)

                  What we (MSFT) know that’s missing and hope to support in the near future

                  1. Native platform support in alarm/reminder to automatically handle time conversion when time-zone changes (Workaround – this can be done by the app manually by using the TimeZoneChange system trigger);
                  2. Native platform support in alarm/reminder for recurrence events (Workaround – this can currently only be done by the app manually periodically waking up and reschedule a bunch of alarms/reminders ahead of time);

                  3. Native platform support to select a song from Music library as ring tone for alarm/reminder (Workaround – this can be done by reading and copying files from your music library, and then use the saved/modified version of the file in your app package or app data as the ring tone (toast notification supports custom sound by pointing to files in appx or appdata in the xml payload)).

                  这篇关于我可以为Window Universal App创建一个警报应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:BitBlt 屏幕截图在 Windows 10 上不起作用 下一篇:Xunit 单元测试不会运行

                  相关文章

                • <legend id='7b5Aa'><style id='7b5Aa'><dir id='7b5Aa'><q id='7b5Aa'></q></dir></style></legend><tfoot id='7b5Aa'></tfoot>
                • <i id='7b5Aa'><tr id='7b5Aa'><dt id='7b5Aa'><q id='7b5Aa'><span id='7b5Aa'><b id='7b5Aa'><form id='7b5Aa'><ins id='7b5Aa'></ins><ul id='7b5Aa'></ul><sub id='7b5Aa'></sub></form><legend id='7b5Aa'></legend><bdo id='7b5Aa'><pre id='7b5Aa'><center id='7b5Aa'></center></pre></bdo></b><th id='7b5Aa'></th></span></q></dt></tr></i><div id='7b5Aa'><tfoot id='7b5Aa'></tfoot><dl id='7b5Aa'><fieldset id='7b5Aa'></fieldset></dl></div>

                  <small id='7b5Aa'></small><noframes id='7b5Aa'>

                        <bdo id='7b5Aa'></bdo><ul id='7b5Aa'></ul>