c# - 如何向 WPF 应用程序图标添加通知徽章,以便它出现在应用程序图标出现的所有位置,而不仅仅是窗口标题栏?
问题描述
我有一个带有图标的 WPF 应用程序AutoPBW.ico
。现在,如果我在 MainWindow.xaml.cs 中使用此代码:
if (hosting && playerReady)
Icon = new BitmapImage(new Uri("AutoPBW-hosting-playerReady.ico", UriKind.Relative));
else if (hosting)
Icon = new BitmapImage(new Uri("AutoPBW-hosting.ico", UriKind.Relative));
else if (playerReady)
Icon = new BitmapImage(new Uri("AutoPBW-playerReady.ico", UriKind.Relative));
else
Icon = new BitmapImage(new Uri("AutoPBW.ico", UriKind.Relative));
通过将图标替换为三个备用图标之一或原始图标,我可以使两个徽章之一出现,或两者都出现,或不显示。
我的问题是:如果我这样做,图标只会在我的窗口标题栏中发生变化;它不会在任务栏或通知托盘中更改(使用 Hardcodet.Wpf.TaskbarNotification 库使通知托盘图标出现)。如何在所有位置更改我的应用程序的图标,而不仅仅是在窗口的标题栏中?
解决方案
推荐阅读
- apache-spark - 从嵌套数据框列中删除换行符
- owl-api - OWL API NoSuchMethodError
- c# - 字符串之间的最佳匹配
- python - 更改 Django autocomplete_fields 标签
- python - 在类中装饰 @property.setter 装饰器
- java - 比较两个对象列表并通过比较java 8中两个列表的一个属性来形成一个新列表
- c++ - 2019 - 使用 C++ 进行点云体积估计
- c# - 查询父母的记录在哪里孙子的条件
- kubernetes - 带有服务帐户令牌的 Kubernetes kubeconfig
- postgresql - 通过 calcite 在 postgres 中创建物化视图