private void OnNotificationOccuredEvent(NotificationOccurredEvent e) { if (e != null && e.Notification != null) { var notification = e.Notification; NotificationTitle = notification.NotificationTitle; NotificationType = notification.NotificationType; NotificationText = notification.NotificationText; CanConfirm = notification.CanConfirm; ConfirmInfo = notification.ConfirmInfo; ConfirmEvent = notification.ConfirmEvent; CanDecline = notification.CanDecline; DeclineInfo = notification.DeclineInfo; DeclineEvent = notification.DeclineEvent; CanCancel = notification.CanCancel; CancelInfo = notification.CancelInfo; CancelEvent = notification.CancelEvent; if (NotificationImages.ContainsKey(NotificationType)) { NotificationImage = NotificationImages[NotificationType]; } } }
private void OnNotificationOccurredEvent(NotificationOccurredEvent e) { if (e != null) { Log.InfoFormat("OnNotificationOccurredEvent() => {0}", e.ToString()); PopupContent = Content.PopupContent.Notification; } }
private void Run_ShowANotificationToTheUserDemo() { var fatalEvent = new NotificationOccurredEvent( new NotificationModel( "FatalDemo", NotificationType.Fatal, Strings.Notification_Fatal, string.Format(Strings.Notification_FatalDemoLongText, Strings.Notification_DefaultButtonConfirm), true, null, "", true, null, "", true, null, "") ); var errorEvent = new NotificationOccurredEvent( new NotificationModel( "ErrorDemo", NotificationType.Error, Strings.Notification_Error, string.Format(Strings.Notification_ErrorDemoLongText, Strings.Notification_DefaultButtonConfirm), true, fatalEvent, "", true, null, "", true, null, "") ); var warnEvent = new NotificationOccurredEvent( new NotificationModel( "WarnDemo", NotificationType.Warning, Strings.Notification_Warn, string.Format(Strings.Notification_WarnDemoLongText, Strings.Notification_DefaultButtonConfirm), true, errorEvent, "", true, null, "", true, null, "") ); var successEvent = new NotificationOccurredEvent( new NotificationModel( "SuccessDemo", NotificationType.Success, Strings.Notification_Success, string.Format(Strings.Notification_SuccessDemoLongText, Strings.Notification_DefaultButtonConfirm), true, warnEvent, "", true, null, "", true, null, "") ); var infoEvent = new NotificationOccurredEvent( new NotificationModel( "InfoDemo", NotificationType.Info, Strings.Notification_Info, string.Format(Strings.Notification_InfoDemoLongText, Strings.Notification_DefaultButtonConfirm), true, successEvent, "", true, null, "", true, null, "") ); var Event = new NotificationOccurredEvent( new NotificationModel( "NoneDemo", NotificationType.None, Strings.Notification_Welcome, string.Format(Strings.Notification_WelcomeDemoLongText, Strings.Notification_DefaultButtonConfirm), true, infoEvent, "", true, null, "", true, null, "") ); EventAggregator?.Publish <NotificationOccurredEvent>(Event); }