https://github.com/thomaslevesque/toasthelper
A strongly typed helper for toast notifications in Windows Store apps
https://github.com/thomaslevesque/toasthelper
Last synced: 11 months ago
JSON representation
A strongly typed helper for toast notifications in Windows Store apps
- Host: GitHub
- URL: https://github.com/thomaslevesque/toasthelper
- Owner: thomaslevesque
- Created: 2013-11-10T01:39:56.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-11-11T19:16:18.000Z (over 12 years ago)
- Last Synced: 2024-11-14T04:40:50.201Z (over 1 year ago)
- Language: C#
- Size: 152 KB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ToastHelper
===========
A strongly typed helper for toast notifications in Windows Store apps
It can be used like this:
```csharp
var content = new ToastContent.ImageAndText02
{
Image = "ms-appx:///Images/dotnet.png",
Title = "Hello world!",
Text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
};
var notifier = ToastNotificationManager.CreateToastNotifier();
notifier.Show(content.CreateNotification());
```
Or, if you don't need strong typing but don't want to manipulate the XML directly, you can do this:
```csharp
var content = new ToastContent(ToastTemplateType.ToastImageAndText02);
content.SetImage(1, "ms-appx:///Images/dotnet.png");
content.SetText(1, "Hello world!");
content.SetText(2, "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
var notifier = ToastNotificationManager.CreateToastNotifier();
notifier.Show(content.CreateNotification());
```