Visual studio 2015 如何在Windows 10应用程序中设置Toast功能

Visual studio 2015 如何在Windows 10应用程序中设置Toast功能,visual-studio-2015,windows-runtime,uwp,Visual Studio 2015,Windows Runtime,Uwp,我想知道如何在UWP应用程序中设置toast功能。我使用的是Visual Studio 2015,在Package.appxmanifest编辑器中没有任何选项。我试图手动编辑xml,msdn说你可以像那样手动添加 <VisualElements ... ToastCapable="true"> </VisualElements> 但我发现.appxmenifest就是这样的 <uap:VisualElements DisplayName="Name" Sq

我想知道如何在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中,您不再需要设置Toastable标志:

嗯,好吧,你肯定需要把toastable设置为true 清单8.1要求这样做,否则你的祝酒器将无法工作 8.1(在10年,我们不再需要Toastable标志)

资料来源:


您可以在GitHub上的quickstart中自己验证它。

是的,示例代码中没有任何ToastCapable标志,它可以工作。谢谢你的回答,但我想知道,Windows 10有一个应用程序列表,可以在设备上显示通知,这样你就可以在设置应用程序中打开和关闭它,如果没有这样的标志,操作系统如何知道哪些应用程序能够通知?在创建应用程序包时,是否有某种工具分析代码,将该信息添加到包中?Windows 10应用商店会在提交时重新编译应用程序,并剥离不需要的功能。如果它也检查烤面包片,我不会感到惊讶,尽管我不是100%确定。