/// <summary> /// Handles the message. /// </summary> /// <param name="message">The message.</param> public void Handle(SendNotification message) { // TODO: this is hacky... message.Message = String.Format("{0:HH:mm}: {1}", DateTime.Now, message.Message); Execute.OnUIThread( () => { var vm = new NotificationViewModel(message); Items.Add(vm); ActivateItem(vm); if (message.HideAfter > 0) { Task.Run(async() => { await Task.Delay(message.HideAfter); await Execute.OnUIThreadAsync(vm.CloseAnimated); }); } }); }
public NotificationViewModel(SendNotification notification) { Notification = notification; closeDuration = new Duration(TimeSpan.FromSeconds(1)); }
public NotificationViewModel(SendNotification notification) { Notification = notification; closeDuration = new Duration(TimeSpan.FromSeconds(1)); }