久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

來自 Windows 10 桌面應用程序的吐司通知中的意外

Unexpected behaviours in toast notification from desktop app in Windows 10(來自 Windows 10 桌面應用程序的吐司通知中的意外行為)
本文介紹了來自 Windows 10 桌面應用程序的吐司通知中的意外行為的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我從 Windows 8.1 開始使用桌面應用程序的 toast 通知,但使用 Windows 10 中的新操作中心,我遇到了一些意外行為.

I used the toast notifications for desktop app since Windows 8.1 but with the new action center in Windows 10, I am experiencing some unexpected behaviours.

當用戶對 Toast 不做任何操作時,它會直接消失而無需進入操作中心(ToastNotification.DismissedToastDismissalReason.TimedOut).我不知道這是否與我在 win32 應用程序中使用它有關,但 Windows 通用應用程序中的相同 toast 在超時時進入操作中心.

When the user do nothing with the toast, it simply disappear without going to the action center (ToastNotification.Dismissed is ToastDismissalReason.TimedOut). I don't know if it related to the fact that I use it in a win32 app but the same toast in a Windows Universal App goes to the action center when it timed out.

需要注意的一點是我沒有注冊 AppUserModelID 對于我在 W8.1 中需要的 win32 應用程序,它似乎不再是強制性的.我仍然用注冊的 id 測試,我也有同樣的問題.

One thing to note is that I have not registered an AppUserModelID for my win32 app like it was needed in W8.1, it seems to not be mandatory anymore. I still tested with a registered id, and I had the same popblem.

那么,我怎樣才能防止 toast 在超時時不進入操作中心?

So, how can i prevent the toast from not going in the action center when it timed out ?

這是重現問題的極簡代碼(控制臺應用程序):

Here is a minimalist code (console app) that reproduces the issue :

using Windows.Data.Xml.Dom;
using Windows.UI.Notifications;

namespace ToastDesktop
{
    internal class Program
    {
        /// Add in the .csproj in the <PropertyGroup/> where <TargetFrameworkVersion/> is:
        /// <TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
        ///
        /// Reference to add :
        /// - Windows.UI
        /// - Windows.Data
        private static void Main(string[] args)
        {
            string xml = $@"
                <toast>
                    <visual>
                        <binding template='ToastGeneric'>
                            <text>Some title</text>
                            <text>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</text>
                        </binding>
                    </visual>
                </toast>";

            XmlDocument doc = new XmlDocument();
            doc.LoadXml(xml);

            ToastNotification toast = new ToastNotification(doc);
            toast.Tag = "tag";
            toast.Group = "group";

            ToastNotificationManager.CreateToastNotifier("ToastDesktop").Show(toast);
        }
    }
}

感謝您的幫助.

我在 涵蓋該主題的 msdn 博客文章,我得到確認,它應該在超時時保留在操作中心,并且它可能是一個錯誤.

Edit : I posted this bug on the msdn blog post that cover the subject and I got the confirmation that it should remain in the action center when timed out and that it might be a bug.

推薦答案

Win32 應用程序需要設置 COM 服務器才能在操作中心持久化 toast:http://blogs.msdn.com/b/tiles_and_toasts/archive/2015/10/15/quickstart-handling-toast-activations-from-win32-apps-in-windows-10.aspx

Win32 apps need to set up a COM server in order to have toasts persisted in Action Center: http://blogs.msdn.com/b/tiles_and_toasts/archive/2015/10/15/quickstart-handling-toast-activations-from-win32-apps-in-windows-10.aspx

這篇關于來自 Windows 10 桌面應用程序的吐司通知中的意外行為的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

LINQ to SQL and Concurrency Issues(LINQ to SQL 和并發問題)
Yield return from a try/catch block(try/catch 塊的收益回報)
Should I call Parameters.Clear when reusing a SqlCommand with a transation?(重用帶有事務的 SqlCommand 時,我應該調用 Parameters.Clear 嗎?)
what does a using statement without variable do when disposing?(處理時不帶變量的 using 語句有什么作用?)
Why doesn#39;t TransactionScope work with Entity Framework?(為什么 TransactionScope 不適用于實體框架?)
How to dispose TransactionScope in cancelable async/await?(如何在可取消的 async/await 中處理 TransactionScope?)
主站蜘蛛池模板: 91免费观看 | 国产成人网 | 亚洲一区二区三区四区五区中文 | a级在线免费 | 亚州午夜精品 | 精品免费国产视频 | 中文字幕视频一区 | 精品国产一区二区三区久久久蜜月 | 日韩在线免费 | 五月免费视频 | 日韩一二三区 | 亚洲成av人片在线观看 | 在线观看亚洲专区 | 91久久夜色 | 在线播放中文 | 久久精品一级 | 欧美亚洲免费 | 国产精品一区久久久久 | 国产精品免费一区二区三区 | 天天干天天谢 | 午夜视频精品 | 麻豆久久久久久 | 欧美日高清视频 | 黄色成人免费在线观看 | 国产偷录视频叫床高潮对白 | 欧美a区 | 天天干com | 日韩一级| 国产人免费人成免费视频 | 国产羞羞视频在线观看 | 欧美videosex性极品hd | 国产99久久久久 | 精品久久久久久久久久久 | 视频1区 | 欧美一区二区三区视频 | 欧美综合一区二区 | 人人干在线| 91免费在线 | 免费99视频 | 亚洲精品一区二区三区 | 亚洲人成人一区二区在线观看 |