Reputation: 9841
I am new to Windows Phone 8 development. I wanted to show Toast notifiation
, and it is suggested that I need to change in Package.Appxmanifest file. I am using C# as language.
I am using VS2012 Express for Windows Phone
. WMAppManifest.xml
and AppManifest.xml
created by Visual Studio wizard, but I am not able to find Package.Appxmanifest
.
Please suggest if there any other way to show toast notification.
Code to display toast:
string toast = "This is toast";
ShellToast t = new ShellToast();
t.Title = "Non null";
t.Content = toast;
t.Show();
Upvotes: 0
Views: 2494
Reputation: 6424
EDIT:
Ok, now I see you are trying to create and show a local toast notification. The point is that you can't show toast notifications while the app is in foreground. They can be shown from a Background Agent
while your app is not on the foreground. Your code is ok, but it should be places in a Background Agent
.
If you still want to show a toast notification within your app, you can do so using the ToastPrompt
control from the Coding4Fun toolkit:
ToastPrompt toast = new ToastPrompt();
toast.Title = "Title";
toast.Message = "message";
toast.ImageSource = new BitmapImage(new Uri("ImageUri", UriKind.RelativeOrAbsolute));
toast.Show();
Your linked post is about Windows Store apps.
For Windows Phone apps you need to check ID_CAP_PUSH_NOTIFICATION
capability in WMAppManifest.xml file:
Upvotes: 1