//Command private void ButtonCommand_Click(object sender, RoutedEventArgs e) { try { string command = new TextRange(RichTextBoxCommand.Document.ContentStart, RichTextBoxCommand.Document.ContentEnd).Text; _listener.SendCommand(_client.Id, command, false); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }