0

我是Windows Phone 8开发新手。我想显示Toast notifiationit is suggested that I need to change in Package.Appxmanifest file。我使用C#作为语言。我正在使用VS2012 Express for Windows PhoneWMAppManifest.xmlAppManifest.xml由Visual Studio向导创建,但我无法找到Package.Appxmanifest为什么在Windows Phone Express的Visual Studio 2012中找不到Package.Appxmanifest?

请建议是否有其他方式显示吐司通知。

enter image description here

代码以显示敬酒:

string toast = "This is toast"; 
ShellToast t = new ShellToast(); 
t.Title = "Non null"; 
t.Content = toast; 
t.Show(); 
+1

值得指出的是链接的答案是Windows应用商店的应用程序为Windows 8/RT(而不是Windows Phone 8);有关于发送[Toast for Windows Phone on MSDN]的良好文档(http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662938%28v=vs.105%29.aspx#BKMK_Howtosendatoastnotification) –

+0

+1。谢谢。我会通过建议的链接。 –

+0

@rockstartprogrammer我编辑了答案,现在我看到你正在尝试做什么。您应该编辑问题的标题,因为它与问题没有任何关系。 – anderZubi

回答

1

编辑:

好了,现在我看你要创建和显示local toast notification。问题是,当应用程序处于前台时,您无法显示敬酒通知。当您的应用不在前台时,它们可以从Background Agent中显示。你的代码没问题,但应该放在Background Agent

如果你仍然想显示你的应用程序中的Toast通知,你可以这样做使用从Coding4Fun toolkitToastPrompt控制:

ToastPrompt toast = new ToastPrompt(); 
toast.Title = "Title"; 
toast.Message = "message"; 
toast.ImageSource = new BitmapImage(new Uri("ImageUri", UriKind.RelativeOrAbsolute)); 
toast.Show(); 

你的链接文章是关于Windows应用商店的应用。

对于的Windows Phone应用程序你需要检查ID_CAP_PUSH_NOTIFICATION能力WMAppManifest.xml文件:

enter image description here

+0

经过大量调试之后,我保留了所有功能。问题仍然存在。 –

+0

这是什么问题? – anderZubi

+0

我第一次尝试使用'ID_CAP_PUSH_NOTIFICATION',但不起作用。 –

相关问题