private void OnMessageSent(NotificationType type, MessageSendResult result) { PushNotificationsLogMsg msg = new PushNotificationsLogMsg(type, result); Dispatcher.BeginInvoke((Action)(() => { trace.Add(msg); })); }