Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6242429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:57:14+00:00 2026-05-24T11:57:14+00:00

I like to using binaryformatter to serializing flow document. but it makes exception. [Serializable]

  • 0

I like to using binaryformatter to serializing flow document. but it makes exception.

[Serializable]
public class BinFlow
{
    public FlowDocument my { get; set; }
}


BinFlow myBF = new BinFlow();
myBF.my = myFlowDocument;

FileStream myFile = File.Create(@"d:\test.bin");
BinaryFormatter myBinaryFormat = new BinaryFormatter();

//exception occured here!!
myBinaryFormat.Serialize(myFile, myBF);

Exception message said “FlowDocument does not decared ‘Serializable’ proeprty”.

ps. Of cause, I can use XamlReader and XamlWriter for serializing of FlowDocument. but I think binary can more fast performance for this work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:57:15+00:00Added an answer on May 24, 2026 at 11:57 am

    I am assuming you are asking for your related question — to shuttle your FlowDocument from one thread to another. I’ve never had any success using BinaryFormatter. Unless your FlowDocument is very large (say, more than 100 MB), you can easily save it to memory to share between threads as a memory stream like this:

    MemoryStream stream = new MemoryStream();
    XamlWriter.Save(myFlowDoc, stream);
    stream.Position = 0;
    

    You can share MemoryStream between threads, and avoid disk IO. On your other thread, use XamlReader.Load from the MemoryStream.

    If you do want to write it to disk in a binary format I’d say get the Xaml, then use the compression libraries to make a ZIP file, as XPS does.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When you have some property that's like: using Algebra; public Algebra.Vector3 Direction { get
Basically like using the out keyword. But the problem is with the out keyword,
for example I'm trying to get the data from database like: using (ExplorerDataContext context
I do not like using namespace std , but I am also tired of
I don't really like using plists (I know I should get used to it,
Lets say i have a class [Serializable()] public class Car { public string model;
I like using sentry classes in c++, but I seem to have a mental
My code is like this: [Serializable] [StructLayout(LayoutKind.Sequential,Pack=1)] struct Foo { public byte Bar; public
I like using nib files to configure some subviews, but for other subviews i
I like using the ReSharper unit test runner, but it doesn't support the TestCase

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.