Beispiel #1
0
        private void SendToastWithHeader(PHPost post, int rnd, DateTimeOffset currentTime, int rank)
        {
            var toastContent = new ToastContent()
            {
                Header = new ToastHeader($"{rnd}", string.Format("{0:t}", currentTime), "oof"),
                Visual = new ToastVisual()
                {
                    BindingGeneric = new ToastBindingGeneric()
                    {
                        Children =
                        {
                            new AdaptiveText()
                            {
                                Text = $"{PickRankBasedOnIndex(rank)} - {post.Name}"
                            },
                            new AdaptiveText()
                            {
                                Text = $"{post.Description}"
                            }
                        },
                        AppLogoOverride = new ToastGenericAppLogo()
                        {
                            Source = $"{post.Thumbnail.Url}"
                        }
                    }
                },
                Launch         = $"{post.Url}",
                ActivationType = ToastActivationType.Protocol
            };

            // Create the toast notification
            var toastNotif = new ToastNotification(toastContent.GetXml());

            // And send the notification
            ToastNotificationManager.CreateToastNotifier().Show(toastNotif);
        }
Beispiel #2
0
 public Product(PHPost post, int ranking)
 {
     Post    = post;
     Ranking = ranking;
 }