private void SendBadge_Click(object sender, RoutedEventArgs e)
        {
            BadgeNumericNotificationContent badgeContent = new BadgeNumericNotificationContent(81);

            BadgeUpdateManager.CreateBadgeUpdaterForApplication().Update(badgeContent.CreateNotification());

            OutputTextBlock.Text = badgeContent.GetContent();
            rootPage.NotifyUser("Badge sent", NotifyType.StatusMessage);
        }
Exemplo n.º 2
0
        void UpdateBadgeWithNumber(int number)
        {
            // Note: This sample contains an additional project, NotificationsExtensions.
            // NotificationsExtensions exposes an object model for creating notifications, but you can also modify the xml
            // of the notification directly. See the additional function UpdateBadgeWithNumberWithStringManipulation to see how to do it
            // by modifying strings directly

            BadgeNumericNotificationContent badgeContent = new BadgeNumericNotificationContent((uint)number);

            // send the notification to the app's application tile
            BadgeUpdateManager.CreateBadgeUpdaterForApplication().Update(badgeContent.CreateNotification());

            OutputTextBlock.Text = badgeContent.GetContent();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Generates badge notification of goldCount change for receiver.
        /// </summary>
        /// <param name="goldCount">The goldCount of the user.</param>
        /// <returns>String representation of badge object.</returns>
        private string GenerateBadgeNotification(uint goldCount)
        {
            BadgeNumericNotificationContent badgeContent = new BadgeNumericNotificationContent(goldCount);

            return(badgeContent.GetContent());
        }