在WPF中设置吐司通知的显示名称

ahy6op9u  于 6个月前  发布在  其他
关注(0)|答案(2)|浏览(97)

我正在使用一个针对net6.0-windows10.0.17763.0的简单Wpf应用程序来尝试Microsoft.Toolkit.Uwp.Notifications的吐司通知功能,这是这些toast工作所必需的。
现在,吐司的header/title/display name在本例中显示了App项目的名称(程序集名称)WpfApp1(见图),我无法找到如何在不更改程序集名称的情况下将其更改为适当的名称。
我的问题是-有可能设置吗?

  • 注意事项:在WinUI 3中有一个Package.Manifest,它有一个“Display Name”属性,会影响吐司顶部的文本,但我想使用WPF应用程序。

我的吐司代码看起来像这样:

new ToastContentBuilder()
  .AddArgument("action", "viewConversation")
  .AddArgument("conversationId", 9813)
  .AddText("Andrew sent you a picture")
  .AddText("Check this out, The Enchantments in Washington!")
  .AddHeader("1", "LOOK HERE", "")
  .Show();

字符串
x1c 0d1x的数据

icomxhvb

icomxhvb1#

项目文件中的AFAIK,AssemblyTitle,如果指定的话,用于吐司的顶部文本。不过我还没有找到任何关于这个的文档。

<PropertyGroup>
  <OutputType>WinExe</OutputType>
  <TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
  <UseWPF>true</UseWPF>
  <AssemblyTitle>The text used for the toast</AssemblyTitle>
</PropertyGroup>

字符串

mm9b1k5b

mm9b1k5b2#

看起来你不能在吐司级别上更改它:https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/adaptive-interactive-toasts?tabs=appsdk#app-notification-structure(特别是“属性区域”)。

相关问题