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 3320684
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:58:21+00:00 2026-05-17T22:58:21+00:00

I have created an object called Project that has different properties (strings and some

  • 0

I have created an object called Project that has different properties (strings and some custom objects), I have bound text fields to these properties to get user input. I have created a method that outputs this object to an XML file. However when I import this XML file back into memory the text fields do not become populated with the text or list views of some custom objects that inherit from ObservableCollection do not have any text. The XML does load properly since if I enter text into the empty fields it updates the property and I can export an XML file with the new values.

To load the xml I use the following code

public void LoadXML()
    {
        OpenFileDialog fileDialog = new OpenFileDialog();
        fileDialog.Title = "Load XML File";
        fileDialog.Filter = "XML Files|*.xml";
        DialogResult result = fileDialog.ShowDialog();

        if (result.ToString().Equals("OK"))
        {
            string filePath = fileDialog.FileName.ToString();
            XmlSerializer serializer = new XmlSerializer(typeof(Project));
            TextReader textReader = new StreamReader(filePath);
            newProject = (Project)serializer.Deserialize(textReader);
            textReader.Close();
        }

    }

Any suggestions would be welcomed, thanks.

  • 1 1 Answer
  • 1 View
  • 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-17T22:58:22+00:00Added an answer on May 17, 2026 at 10:58 pm

    I assume you use WPF.

    You need to implement the INotfiyPropertyChanged-Interface and throw its event for every Property of your class that is tied to a Control.

    WPF then updates your GUI accordingly, when you deserialize the Project from XML. If it does not, check if the DataContext of your control is set to the Project instance that you deserialized.

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

Sidebar

Related Questions

Let me first describe my goal: I have created an object with 3 properties:
Good day, I have created an object that will manage data access. My app
I'm hoping someone can help on this one, I have created a custom object
i have created an IE band object (toolbar) that is working well. however, when
I have created some python code which creates an object in a loop, and
I have an ExpenseType object that I have created with the following migration: class
I have created a method that should ideally take a single Account object and
I have two classes in a different projects. I am importing the project that
In a current project, I have a model called Box that stores items from
I've created a UserControl called CatalogBrowser which has a property ListedFamilies that exposes the

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.