If the file is part of your project, you can add the file to your project as a resource. This means that the Build Action file must be Resource . And the next function can read the file from the project resource.
Stream stream = this.GetType().Assembly.GetManifestResourceStream("Namespace.FileName.FileExtentation");
Now you can read the stream according to the file type. If it is an XML file, you can read it as shown below.
As an example
XElement element = XElement.Load(stream); foreach (XElement phraseElement in element.Elements()) { MyClass foo = new foo(); foreach (XAttribute attribute in phraseElement.Attributes()) foo.Text = attribute.Value; }
How to write isolated storage and read a file from isolated storage? Please read the following link
http://www.codebadger.com/blog/post/2010/09/03/Using-Isolated-Storage-on-Windows-Phone-7.aspx
You can also check the link below regarding the local data store for Windows Phone.
http://msdn.microsoft.com/en-us/library/ff626522%28v=vs.92%29.aspx
source share