Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
200
Import/Export data from/to MemoryStream
posted

Hello,

I'd like to import/export text formatted data from/to XamRichTextEditor using MemoryStream. 

I did the following for import, but text data wasn't displayed in  XamRichTextEditor:

using (MemoryStream ms = new MemoryStream())
{
  using (StreamWriter sr = new StreamWriter(ms))
  {
    string text = "Test data format.";
    sr.WriteLine(text);
    sr.Flush();

    RichTextDocument rtd = new RichTextDocument();
    rtd.LoadFromPlainText(ms);
    XamRichTextEditor1.Document = rtd;

  }

}

Could you provide me any sample how to import/export text formatted data from/to XamRichTextEditor using MemoryStream?

Thank you.

Alexander.