internal WinRTToastNotification(IPredefinedToastNotificationContent content, Func <IToastNotificationAdapter> adapterRoutine) { if (content == null) { throw new ArgumentNullException("content"); } this.adapterCore = new Lazy <IToastNotificationAdapter>(adapterRoutine); this.contentCore = content; this.handlerDismissed = new ToastNotificationHandlerInfo <HandlerDismissed>(() => new HandlerDismissed(this)); this.handlerActivated = new ToastNotificationHandlerInfo <HandlerActivated>(() => new HandlerActivated(this)); this.handlerFailed = new ToastNotificationHandlerInfo <HandlerFailed>(() => new HandlerFailed(this)); }
public INotification CreatePredefinedNotification( string text1, string text2, string text3, ImageSource image = null) { IPredefinedToastNotificationContentFactory cf = PredefinedNotificationsFactory.CreateContentFactory(); IPredefinedToastNotificationContent content = null; switch (PredefinedNotificationTemplate) { case NotificationTemplate.LongText: content = cf.CreateContent(text1); break; case NotificationTemplate.ShortHeaderAndLongText: content = cf.CreateOneLineHeaderContent(text1, text2); break; case NotificationTemplate.LongHeaderAndShortText: content = cf.CreateTwoLineHeaderContent(text1, text2); break; case NotificationTemplate.ShortHeaderAndTwoTextFields: content = cf.CreateOneLineHeaderContent(text1, text2, text3); break; } if (image != null) { var dpi = PrimaryScreen.GetDpi(); var width = PredefinedNotificationsFactory.ImageSize; var size = new Size(width * dpi.X, width * dpi.Y); content.SetImage(ImageLoader2.ImageToByteArray(image, GetBaseUri, size)); } content.SetDuration((DevExpress.Internal.NotificationDuration)PredefinedNotificationDuration); content.SetSound((DevExpress.Internal.PredefinedSound)Sound); return(new MvvmPredefinedNotification { Notification = PredefinedNotificationsFactory.CreateToastNotification(content) }); }
public IPredefinedToastNotification CreateToastNotification(IPredefinedToastNotificationContent content) { return(new WinRTToastNotification(content, () => ToastNotificationManager.CreateToastNotificationAdapter(appId))); }
public IPredefinedToastNotification CreateToastNotification(IPredefinedToastNotificationContent content) { return(new WpfPredefinedToastNotification((WpfPredefinedToastNotificationContent)content, notifier)); }
public IPredefinedToastNotification CreateToastNotification(IPredefinedToastNotificationContent content) { return new WpfPredefinedToastNotification((WpfPredefinedToastNotificationContent)content, notifier); }