![]() The ToastNotification object has nine content templates, and can play a sound. Windows displays toast notifications for apps that are pinned to the Start menu - ensure your application has a valid shortcut with an Application User Model ID.Īpplication Shortcut and Troubleshootingĭrop the ToastNotificationManager component from Visual Studio’s toolbox onto the form.Customize Notifications with the “Generic” Template. For debugging purposes, invoke the component’s smart tag and click the “Create Application Shortcut” link. See the Application Shortcut and Troubleshooting section for more information. Invoke the manager’s smart-tag and click the Edit Notifications… link. In the Collection Editor dialog, click Add to add a notification. This creates new ToastNotification objects and adds them to the manager’s ToastNotificationsManager.Notifications collection. You can customize the notification settings in the property grid. ToastNotification.Body and IToastNotificationProperties.Body2 - two regular text strings that are the main notification text. ![]() The Body2 line can be disabled, depending on the selected template (see below). ToastNotification.Duration - gets or sets how long the notification is visible if a user does not close it. ToastNotification.Header - a bold text string displayed in the notification header. The header string can occupy one or two lines, depending on the notification template. ToastNotification.ID - a read-only property that stores a unique notification ID. ToastNotification.Image - gets or sets the notification image. ToastNotification.Sound - allows you to specify a sound to accompany the notification. ToastNotification.Template - gets or sets the notification template. ![]() ![]() The table below illustrates different notification types.Ī IToastNotificationProperties.Body string that occupies a maximum of three lines.Ī bold IToastNotificationProperties.Header text string on the first line and a IToastNotificationProperties.Body text string wrapped across the second and third lines. ToastNotification.HeroImage (364x180 pixels).ToastNotification.Body and IToastNotificationProperties.Body2.Ĭropped according to the ToastNotification.AppLogoImageCrop property value ToastNotification.AppLogoImage (48x48 pixels at 100% scaling).The following properties provide its content: One string of bold IToastNotificationProperties.Header text that occupies the first and second lines, and a IToastNotificationProperties.Body text on the third line.īold IToastNotificationProperties.Header text on the first line, a IToastNotificationProperties.Body string on the second line, and a IToastNotificationProperties.Body2 string on the third line.Ī Windows 10-style notification. To display a specific notification, use the ToastNotificationsManager.ShowNotification method. ![]()
0 Comments
Leave a Reply. |