Save chart within a FlowDocument to file?

Nov 9, 2011 at 2:41 PM

Is it possible to save a Chart within a FlowDocument to file. I add a chart and it displays fine on screen, then when it is saved to a XamlPackage using the code below but file doesn't contain the Chart, and when loaded and displayed this detail is missing.

var range = new TextRange(Document.ContentStart, Document.ContentEnd);
using (var stream = System.IO.File.Create(filename))
{
    range.Save(stream, DataFormats.XamlPackage);
}

Is there a way to save the Chart to file too?

Thanks
Chunda