private void Flyout_Closed(object sender, object e) { var text = string.Empty; var selection = EditBox.Document.Selection; selection.Expand(TextRangeUnit.Window); if (!string.IsNullOrWhiteSpace(selection.Text.Trim('\r', '\n'))) { EditBox.Document.GetText(TextGetOptions.FormatRtf, out text); } node.ChangeNotesTransactional(text); }