private void SendResult(object sender, RoutedEventArgs e) { //read the selected text in logpanel, turn it to xelement var content = ReadSelectedOrWholeText(); if (string.IsNullOrEmpty(content)) { MessageBox.Show("No selected text."); return; } var steps = XElement.Parse(content); var ret = _defaultClientInstance.SendResult(steps); Log.Debug(ret); SetPanel(ret); }