private void _tabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (_tabControl.SelectedItem == _previewTabItem)
{
if (string.IsNullOrWhiteSpace(_commentTextBox.Text))
{
_textEditor.Document.Text = "";
}
else
{
var digitalSignature = _signatureComboBox.SelectedItem as DigitalSignature;
var comment = _commentTextBox.Text.Substring(0, Math.Min(_commentTextBox.Text.Length, Message.MaxCommentLength));
_textEditor_Helper.Set(_textEditor, DateTime.UtcNow, digitalSignature.ToString(), 0, comment);
}
}
}