Skip to content

Instantly share code, notes, and snippets.

@anaisbetts
Created May 23, 2013 02:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anaisbetts/5632430 to your computer and use it in GitHub Desktop.
Save anaisbetts/5632430 to your computer and use it in GitHub Desktop.
var toast = ToastContentFactory.CreateToastText02();
var item = x.First();
toast.TextHeading.Text = item.Subject.Type;
toast.TextBodyWrap.Text = "DO IT";
toast.Lang = "en_US";
toast.BaseUri = "http://google.com";
toast.Duration = BoxKite.Notifications.ToastDuration.Long;
toast.StrictValidation = false;
ToastNotificationManager.CreateToastNotifier().Show(new ToastNotification(toast.GetXml()));
@shiftkey
Copy link

TO THE MANIFEST

@shiftkey
Copy link

This works for me:

var toast = ToastContentFactory.CreateToastText02();

toast.TextHeading.Text = "A Thing!";
toast.TextBodyWrap.Text = "DO IT";
toast.Lang = "en-US";
toast.BaseUri = "http://google.com";
toast.Duration = BoxKite.Notifications.ToastDuration.Long;
toast.StrictValidation = false;

ToastNotificationManager.CreateToastNotifier().Show(new ToastNotification(toast.GetXml()));

Lang was en_US when it needs to be en-US. I think that's all that was missing.

@anaisbetts
Copy link
Author

Apparently assigning .Lang makes it not appear.

@shiftkey
Copy link

@shiftkey
Copy link

You can use the Event Log to check for errors when your toast notification does not display. Look for events involving your toast notification in the Event Viewer under Applications and Services Logs > Microsoft > Windows > Immersive-Shell > Microsoft-Windows-TWinUI > Operational.

Anything there that might help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment