Reputation: 565
I have FlowDocument as a part of another composite object, what must be serializable.
[Serializable]
public class RichTextSerializationWrapper
{
public FlowDocument Document { get; set; }
}
So, I want serialize RichTextSerializationWrapper as follows:
var serializer = new XmlSerializer(typeof(RichTextSerializationWrapper));
TextWriter writer = new StreamWriter(fileName);
serializer.Serialize(writer, richTextSerializationWrapper);
writer.Close();
And I, of course, get exception:
There was an error reflecting type 'System.Windows.Documents.FlowDocument'.
So, anybody know ways to serialize FlowDocument object into XML?
Thanks.
Upvotes: 0
Views: 3113
Reputation: 50672
According to this question: Saving FlowDocument to SQL Server
Binary and XAML serialization are supported.
Upvotes: 1