/// <summary>
        /// 获取RichTextBox所显示的完整文档所对应的XAML
        /// </summary>
        /// <returns></returns>
        public string GetFlowDocumentXAML()
        {
            //缩进XAML
            string IndentXAML = XAMLHelper.IndentXaml(XamlWriter.Save(_rtf.Document));

            return(IndentXAML);
        }
 /// <summary>
 /// 将当前选中的内容替换为XAML,如果没选中,不做任何事
 /// </summary>
 /// <param name="XAML"></param>
 public void ReplaceSelectionWithXAML(string XAML)
 {
     if (_rtf.Selection.IsEmpty)
     {
         return;
     }
     XAMLHelper.TextRange_SetXml(_rtf.Selection, XAML);
 }
 /// <summary>
 /// 获取当前选中部分的XAML,如果没选中,返回空串
 /// </summary>
 /// <returns></returns>
 public string GetSelectionXAML()
 {
     if (_rtf.Selection.IsEmpty)
     {
         return("");
     }
     return(XAMLHelper.TextRange_GetXml(_rtf.Selection));
 }