久久久久久久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 應用程序中使用它有關(guān),但 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 ?

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

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

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

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

相關(guān)文檔推薦

LINQ to SQL and Concurrency Issues(LINQ to SQL 和并發(fā)問題)
Yield return from a try/catch block(try/catch 塊的收益回報)
Should I call Parameters.Clear when reusing a SqlCommand with a transation?(重用帶有事務的 SqlCommand 時,我應該調(diào)用 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精品在线播放 | 日本在线观看视频 | 欧美男人天堂 | 久久精品—区二区三区 | 久草网址 | 亚洲精品久久区二区三区蜜桃臀 | 黄色精品视频网站 | 黄色一级免费 | 天天干天天想 | 成人国产精品色哟哟 | 99re6在线视频 | 99久久99热这里只有精品 | 伊人婷婷 | av中文字幕在线 | 美女在线一区二区 | 久久久爽爽爽美女图片 | 日韩欧美中文字幕在线观看 | 久久精品亚洲 | 欧美色图综合网 | 亚洲一区电影 | 美女爽到呻吟久久久久 | 久久另类| 国产精品久久久久999 | 国产电影一区二区在线观看 | 日本大片在线播放 | 国产精品一二区 | 欧美 日韩 国产 成人 在线 91 | 天天爱天天操 | 国产午夜影院 | 中文字幕 欧美 日韩 | 国产成人一区 | 亚洲国产成人精品女人久久久 | 久久久久九九九女人毛片 | 日本综合在线观看 | 中文字幕综合 | 人人做人人澡人人爽欧美 | 日韩精品成人一区二区三区视频 | 国产精品亚洲一区二区三区在线观看 | 欧美黄色一区 | 91超碰在线观看 | 中文字幕综合 |