ItemSource from XML file in IsolatedStorage

Thread is closed for posting
2 posts, 0 answers
  1. Justin
    Justin avatar
    15 posts
    Member since:
    Jan 2012

    Posted 16 Aug 2013 Link to this post

    I'm trying to bind the JumpList to a XML file from IsolatedStorage. Some of my code is below, but It doesn't seem to be working. What am I doing wrong?

    public IEnumerable<Phones> GetSavedData()
        IEnumerable<Phones> phoneList = new List<Phones>();
            using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
                string offlineData = Path.Combine("WPTracker", "Offline");
                string offlineDataFile = Path.Combine(offlineData, "phones.xml");
                IsolatedStorageFileStream isoFileStream = myIsolatedStorage.OpenFile(offlineDataFile, FileMode.Open);
                if (myIsolatedStorage.FileExists(offlineDataFile))
                    using (XmlReader xmlReader = XmlReader.Create(isoFileStream))
                        XmlSerializer deserializer = new XmlSerializer(typeof(List<Phones>));
                        List<Phones> phones = deserializer.Deserialize(xmlReader) as List<Phones>;
                            new Comparison<Phones>((Phones p1, Phones p2) =>
                                return p1.FullName.CompareTo(p2.FullName);
                        this.radJumpList1.ItemsSource = phones;
                        return phones;
                    var update = new UpdateDatabase();
        catch (IsolatedStorageException)
            MessageBox.Show("There was an error retireving the data from Isolated Storage.", "The subscriber you are trying to reach can not be located.", MessageBoxButton.OK);
        return phoneList;           
  2. Deyan
    Deyan avatar
    2147 posts

    Posted 21 Aug 2013 Link to this post

    Hi Justin,

    Thanks for writing.

    In general, the code you've pasted looks correct. Can you please share some further details what exactly happens on your side? Do you see any items or you don't see any items at all?

    Is it possible for you to send me a sample project that reproduces the issues you experience so that I can directly take a look and help you out?

    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top