问题描述
我正在尝试使用以下方法在我的 uwp 应用程序中的任务栏图标上显示数字徽章
XmlDocument badgeXml =
BadgeUpdateManager.GetTemplateContent(BadgeTemplateType.BadgeNumber);
// Set the value of the badge in the XML to our number
XmlElement badgeElement = badgeXml.SelectSingleNode("/badge") as XmlElement;
badgeElement.SetAttribute("value",num.ToString());
// Create the badge notification
BadgeNotification badge = new BadgeNotification(badgeXml);
// Create the badge updater for the application
BadgeUpdater badgeUpdater =
BadgeUpdateManager.CreateBadgeUpdaterForApplication();
// And update the badge
badgeUpdater.Update(badge);
有没有办法在红色圆形背景中显示计数,与 Microsoft 团队应用程序相同?
解决方法
我们如何在 uwp 中更改 Windows 应用程序徽章通知的背景颜色
UWP 应用只允许更新 BadgeNumber
或 BadgeGlyph
,目前无法更改徽章通知的背景颜色。上面的屏幕截图是显示带有 TaskbarItemInfo
标志的桌面应用程序,但 UWP 不支持 TaskbarItemInfo
类,如果您确实需要此功能,请随时将您的要求发布到 Windows 反馈中心。>