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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:54:20+00:00 2026-06-03T06:54:20+00:00

How can add elements in an XML file in Windows Phone 7 using anything

  • 0

How can add elements in an XML file in Windows Phone 7 using anything you want like (Linq or XmlWriter) I did it before in normal C# app but in Silverlight and WP7 is different.

The file is in the solution explorer folder (“files/IO.xml”), so no need to give answers about the IsolatedStorage.

My file is like this :

<?xml version="1.0" encoding="utf-8"?>
<lights>
    <light id="1" name="toto" />
    <light id="2" nom="titi" />  
</light>

Any ideas ?

  • 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-03T06:54:21+00:00Added an answer on June 3, 2026 at 6:54 am

    Assuming your file is in IsolatedStorage, you can try something like this:

    using (var store = IsolatedStorageFile.GetUserStoreForApplication())
    {
      using (IsolatedStorageFileStream isoStore = new IsolatedStorageFileStream("IO.xml", FileMode.Open, store))
      {
        XDocument doc = XDocument.Load(isoStore);
        doc.Descendants("lights")
           .FirstOrDefault()
           .Add(new XElement("light", new XAttribute("id","3"), new XAttribute("name","tete"))
    
        doc.Save(isoStore);
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently i am using xpath with linq to xml to add elements after a
I want to add elements after last child in the XML. But I got
I Want to add the data to the xml file from my asp.net GUI.So
I am writing an XML file in C# using XmlWriter. I am able to
I want to add xmlns:atom to the root element of an XML file, the
My question is somewhat weird, but can i add events for any DOM elements(div),
We can add an image to an photo album using UIImage *img = [UIImage
I recently databounded an xml file to a listbox. Now I want to write
using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using System.IO; using System.Xml; using System.Xml.Linq;
I want to read a fairly large xml file. Its small enough to fit

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.