예제 #1
0
        public static void ShowSimpleToast(string text)
        {
            ToastContent toastContent = new ToastContent
            {
                Visual = new ToastVisual
                {
                    BindingGeneric = new ToastBindingGeneric
                    {
                        Children =
                        {
                            new AdaptiveText
                            {
                                Text = text
                            }
                        }
                    }
                },
            };

            ToastNotification           toast = new ToastNotification(toastContent.GetXml());
            OnChatMessageToastEventArgs args  = new OnChatMessageToastEventArgs(toast, null);

            OnChatMessageToast?.Invoke(args);

            PopToast(toast, args);
        }
예제 #2
0
        private static ToastNotification PopToast(ToastContent content)
        {
            ToastNotification toast = new ToastNotification(content.GetXml())
            {
                Data = new NotificationData()
            };
            OnChatMessageToastEventArgs args = new OnChatMessageToastEventArgs(toast, null);

            OnChatMessageToast?.Invoke(args);
            PopToast(toast, args);
            return(toast);
        }
예제 #3
0
        private static void PopToast(ToastContent content, ChatModel chat, string group)
        {
            ToastNotification toast = new ToastNotification(content.GetXml())
            {
                Group = group
            };

            OnChatMessageToastEventArgs args = new OnChatMessageToastEventArgs(toast, chat);

            OnChatMessageToast?.Invoke(args);

            PopToast(toast, args);
        }
예제 #4
0
        public static void ShowAccountMessageToast(string text, string accountBareJid, string tag)
        {
            ToastContent toastContent = new ToastContent
            {
                Visual = new ToastVisual
                {
                    BindingGeneric = new ToastBindingGeneric
                    {
                        Children =
                        {
                            new AdaptiveText
                            {
                                Text = text
                            },
                            new AdaptiveText
                            {
                                Text      = accountBareJid,
                                HintStyle = AdaptiveTextStyle.CaptionSubtle
                            }
                        }
                    }
                },
            };

            ToastNotification toast = new ToastNotification(toastContent.GetXml())
            {
                Group = ACCOUNT_GROUP_PREFIX + accountBareJid,
                Tag   = tag
            };

            OnChatMessageToastEventArgs args = new OnChatMessageToastEventArgs(toast, null);

            OnChatMessageToast?.Invoke(args);

            ToastNotificationManager.History.Remove(tag, ACCOUNT_GROUP_PREFIX + accountBareJid);
            PopToast(toast, args);
        }