Пример #1
0
        private void SpawnEventToast(PusherEvent pusherEvent)
        {
            // Construct the content
            var content = new ToastContentBuilder()
                          .AddToastActivationInfo(pusherEvent.EventData.Message, ToastActivationType.Foreground)
                          .AddText(pusherEvent.EventData.Headline)
                          .AddText(pusherEvent.EventData.Message)
                          .GetToastContent();

            // Create the notification
            var notif = new ToastNotification(content.GetXml());

            // And show it!
            ToastNotificationManager.CreateToastNotifier().Show(notif);
        }
Пример #2
0
        private async Task OnPusherEventReceptionAsync(PusherEventConfig config, PusherClient.PusherEvent rawEvent)
        {
            Debug.WriteLine(config.ChannelName);
            Debug.WriteLine(config.EventName);
            var pusherEvent = PusherEvent.From(rawEvent);

            Debug.WriteLine(pusherEvent.EventData.Message);

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                Events.Add(pusherEvent);
            });

            SpawnEventToast(pusherEvent);
        }