예제 #1
0
        private void ShowNotification(Doro doro)
        {
            string title = doro.Title + " has finished";

            // construct the visuals of the toast
            ToastVisual visual = new ToastVisual()
            {
                BindingGeneric = new ToastBindingGeneric()
                {
                    Children =
                    {
                        new AdaptiveText()
                        {
                            Text = title
                        }
                    },
                    AppLogoOverride = new ToastGenericAppLogo()
                    {
                        Source   = "Assets/StoreLogo-44x44.png",
                        HintCrop = ToastGenericAppLogoCrop.Circle
                    }
                }
            };

            int conversationId = Rand.Next();

            // construct the actions for the toast (inputs and buttons)
            ToastActionsCustom actions = new ToastActionsCustom()
            {
                Inputs =
                {
                    new ToastTextBox("tbNote")
                    {
                        PlaceholderContent = "Add a note"
                    }
                },
                Buttons =
                {
                    new ToastButton("Add Note", new QueryString()
                    {
                        { "action",             "reply"                   },
                        { "conversationId",     conversationId.ToString() },
                        { "dorotitle",          doro.Title                }
                    }.ToString())
                    {
                        ActivationType = ToastActivationType.Foreground,
                        TextBoxId      = "tbNote"
                    }
                }
            };

            // construct the final toast content
            ToastContent toastContent = new ToastContent()
            {
                Visual  = visual,
                Actions = actions,
                Launch  = new QueryString()
                {
                    { "action", "viewConversation" },
                    { "conversationId", conversationId.ToString() }
                }.ToString()
            };

            // And create the toast notification
            var toast = new ToastNotification(toastContent.GetXml());

            toast.ExpirationTime = DateTime.Now.AddDays(2);

            toast.Tag           = "1";
            toast.Group         = "Doro";
            toast.SuppressPopup = false;

            ToastNotificationManager.CreateToastNotifier().Show(toast);
        }
예제 #2
0
 public DoroTimerEvent(string eventDescription, Doro doro)
 {
     EventDescription = eventDescription;
     Doro             = doro;
 }