private void Xenax1_DataReceived(object sender, xenaxCommunicationEventArgs e) { Dispatcher.Invoke(() => { txtCommandHistory.AppendText("\r\n" + e.Data); } ); }
private void Xenax1_DataSent(object sender, xenaxCommunicationEventArgs e) { Dispatcher.Invoke(() => { //TextRange tr = new TextRange(txtCommandHistory.Document.ContentEnd, txtCommandHistory.Document.ContentEnd); //tr.Text = "\r\n--> " + e.Data; //tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Red); txtCommandHistory.AppendText("\r\n--> " + e.Data); } ); }