public void OnClearLog(object sender, LogClearEventArgs args) { ThreadPool.QueueUserWorkItem(delegate { SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext(Application.Current.Dispatcher)); SynchronizationContext.Current.Send(pl => { LogCollection.Clear(); }, null); }); }