visual-studio-2015 - 如何在 Windows 10 应用程序中设置 Toast Capable

标签 visual-studio-2015 windows-runtime uwp

我想知道如何在 UWP 应用中设置 Toast 功能。我正在使用 Visual Studio 2015 并且在 Package.appxmanifest 编辑器中没有任何选项。我试图手动编辑 xml,msdn 说你可以像那样手动添加。

<VisualElements 
...
ToastCapable="true">
</VisualElements>

但我发现 .appxmenifest 就是这样
<uap:VisualElements DisplayName="Name" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Sample" BackgroundColor="transparent">
    <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" ShortName="Name">
    </uap:DefaultTile>
    <uap:SplashScreen Image="Assets\SplashScreen.png" />
    <uap:InitialRotationPreference>
      <uap:Rotation Preference="portrait" />
      <uap:Rotation Preference="landscape" />
      <uap:Rotation Preference="portraitFlipped" />
      <uap:Rotation Preference="landscapeFlipped" />
    </uap:InitialRotationPreference>
  </uap:VisualElements>

如何实现 toast 能力?请帮忙。

最佳答案

在 Windows 10 中,您不再需要设置 ToastCapable 标志:

Hmm, well you definitely need to have ToastCapable set to true in the manifest since 8.1 required that, otherwise your toasts won’t work in 8.1 (in 10, we stopped requiring the ToastCapable flag).



来源:Comment on the official Quickstart guide

您可以在 full source code 中自行验证GitHub 上的快速入门。

关于visual-studio-2015 - 如何在 Windows 10 应用程序中设置 Toast Capable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38463088/

相关文章:

visual-studio - Visual Studio : multiple projects with same name in one solution

python - 使用 Pybind11 将 C++ 扩展到 Python

c# - UWP - 在不更改最小化/关闭按钮颜色的情况下更改后退按钮颜色

c# - ASP.NET Core EF 添加迁移命令不起作用

c# - 光标在 Visual Studio 2015 中消失

c# - 尝试在 Windows 10 通用应用程序中使用 JSON.NET 反序列化对象失败并出现 FileNotFoundException

c# - Windows 8 中不存在 WebClient 类

datetime - 使用 WinRT 设置本地时间戳的格式

c# - 以相同方式设置 StackPanel 中所有按钮的样式 (UWP)

c++-cli - 如何在 UWP 应用中将文本附加到文件