public INoticeHandler AddItem(string message, string caption, MessageBoxIcon icon, ImageSource imageIcon, int?duration, bool canClose, TimeSpan animationDuration, string noticeBoxItemStyle) { return((INoticeHandler)Dispatcher.Invoke(new Func <INoticeHandler>(() => { var noticeBoxItem = new NoticeBoxItem(animationDuration, duration) { Style = XamlUtil.FromXaml <Style>(noticeBoxItemStyle), Caption = caption, Message = message, Icon = icon, ImageIcon = imageIcon, CanClose = canClose, }; noticeBoxItem.Closed += NoticeBoxItem_Closed; noticeBoxItem.Click += NoticeBoxItem_Click; _noticeHandler = new NoticeHandlerImpl(noticeBoxItem); _astkItems.Children.Add(noticeBoxItem); return _noticeHandler; }))); }
internal void TriggerClosed(NoticeBoxItem noticeBoxItem) { Closed?.Invoke(noticeBoxItem, new EventArgs()); }
public NoticeHandlerImpl(NoticeBoxItem noticeBoxItem) { _noticeBoxItem = noticeBoxItem; }