Pranit Kothari
Pranit Kothari

Reputation: 9841

Why Package.Appxmanifest is not found in Visual Studio 2012 for Windows Phone Express?

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.

enter image description here

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

Answers (1)

anderZubi
anderZubi

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:

enter image description here

Upvotes: 1

Related Questions