private void WriteMessage(Brush brush, string message) { Dispatcher.Invoke(DispatcherPriority.Background, new Action(() => { if (logItems.Count > 800) logItems.RemoveAt(0); logItems.Add(new LogItem() { Brush = brush, Text = message }); })); }