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

  • SEARCH
  • Home
  • 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 8040981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:04:11+00:00 2026-06-05T04:04:11+00:00

I have several PathGeometry-s which are showing line between places. I want to save

  • 0

I have several PathGeometry-s which are showing line between places. I want to save these lines. I couldn’t serialize it to XML and don’t know how to store these lines. Is there any chance to do it ?

[EDIT] I have PathGeometry-s at code behind, not in XAML. When i try to use XMLWriter class to store these it gives exception “… classes couldn’t be restored because they dont be known as known types “

  • 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-06-05T04:04:12+00:00Added an answer on June 5, 2026 at 4:04 am

    In case you have the PathGeometry already instantiated as an object you can try to use the XAMLWriter to serialize it MSDN

    e.g.

            var pathgeo = new PathGeometry();
            pathgeo.AddGeometry(new PathGeometry(new PathFigureCollection() { new PathFigure(new Point(10, 50), new List<PathSegment>() { new LineSegment(new Point(200, 70), true) }, false) }));
    
            // Save
            var s = XamlWriter.Save(pathgeo);
    
            byte[] byteArray = Encoding.ASCII.GetBytes(s);
            var stream = new MemoryStream(byteArray);
    
            // Load
            var ob = XamlReader.Load(stream);
    
            // test beeing a System.Windows.Shapes.Path
            test.Data = ob as PathGeometry;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several xml files with different node structure. I want to extract xml
I have several hosts from which i want to do the same query. So
I have several view Partials (like paginator partial) which I want them to be
I have several xml files that are formated this way: <ROOT> <OBJECT> <identity> <id>123</id>
I have several Select which depend on each other if I select a value
I have several classes that I serialize/deserialize, each with a number of properties, some
I have several dropdownlists and textboxes inside an <asp:UpdatePanel> , which should let me
I have several forms which the only difference is the text in the submit
I have several navigation related functions which I would like to have no depth
I have several modifying threads and some reading threads, which all access the global

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.