Пример #1
0
 private void HohoemaInAppNotification_Loaded(object sender, RoutedEventArgs e)
 {
     _messenger.Register <InAppNotificationMessage>(this, (r, m) => PushNextNotication(m.Value));
     _messenger.Register <InAppNotificationDismissMessage>(this, (r, m) =>
     {
         LiteNotification.Dismiss();
     });
 }
Пример #2
0
        private void PushNextNotication(Services.InAppNotificationPayload payload)
        {
            NoticationRequestQueue.Enqueue(payload);

            // 前に表示した通知が時間設定されていない場合には強制非表示
            if (_CurrentNotication != null && _CurrentNotication.ShowDuration == null)
            {
                LiteNotification.Dismiss();
            }
            else
            {
                TryNextDisplayNotication();
            }
        }
Пример #3
0
        private void PushNextNotication(Services.InAppNotificationPayload payload)
        {
            NoticationRequestQueue.Enqueue(payload);

            _ = _uiDispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                // 前に表示した通知が時間設定されていない場合には強制非表示
                if (_CurrentNotication != null && _CurrentNotication.ShowDuration == null)
                {
                    LiteNotification.Dismiss();
                }
                else
                {
                    TryNextDisplayNotication();
                }
            });
        }
Пример #4
0
        public HohoemaInAppNotification()
        {
            this.InitializeComponent();



            var ea = App.Current.Container.Resolve <IEventAggregator>();
            var notificationEvent = ea.GetEvent <Services.InAppNotificationEvent>();

            notificationEvent.Subscribe(OnNotificationRequested, ThreadOption.UIThread);

            var notificationDismissEvent = ea.GetEvent <Services.InAppNotificationDismissEvent>();

            notificationDismissEvent.Subscribe((_) =>
            {
                LiteNotification.Dismiss();
            }, ThreadOption.UIThread);


            LiteNotification.Dismissed += LiteNotification_Dismissed;
        }
Пример #5
0
        public HohoemaInAppNotification()
        {
            this.InitializeComponent();

            var ea = App.Current.Container.Resolve <IEventAggregator>();
            var notificationEvent = ea.GetEvent <Services.InAppNotificationEvent>();

            notificationEvent.Subscribe(PushNextNotication, ThreadOption.UIThread);

            var notificationDismissEvent = ea.GetEvent <Services.InAppNotificationDismissEvent>();

            notificationDismissEvent.Subscribe((_) =>
            {
                LiteNotification.Dismiss();
            }, ThreadOption.UIThread);


            LiteNotification.Closed += LiteNotification_Dismissed;

            Window.Current.CoreWindow.Activated += CoreWindow_Activated;
            _uiDispatcher = Dispatcher;
        }