Windows Phone 8 Can't Update listbox item in XML file after using hardware back button?

Hi All i have a list box and i am saving list box selected item in XML file thats working fine but the problem is that when i will close my app and reopen and add more value to list box my previous value is removed form the xml file and listbox also how
i can save my current added value and previous value in xml file i am using following code :
and iam using following code
<Grid x:Name="ContentPanel" Grid.Row="2" Margin="15,10,15,0">
<ListBox Name="list_location" Tap="list_location_Tap" Foreground="Black">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock x:Name="item_name" Text="{Binding description, Mode=OneWay}" Padding="5,15,5,15" TextWrapping="Wrap" FontSize="{StaticResource PhoneFontSizeLarge}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<ListBox Name="list_locationAdd" Background="Red" Foreground="Black" Visibility="Collapsed">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock x:Name="item_name" Text="{Binding description, Mode=OneWay}" Padding="5,15,5,15" TextWrapping="Wrap" FontSize="{StaticResource PhoneFontSizeLarge}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
and my back end code is follow:
XmlWriterSettings x_W_Settings = new XmlWriterSettings();
x_W_Settings.Indent = true;
using (IsolatedStorageFile ISF = IsolatedStorageFile.GetUserStoreForApplication())
using (IsolatedStorageFileStream stream = ISF.OpenFile(filename, FileMode.Create))
XmlSerializer serializer = new XmlSerializer(typeof(ObservableCollection<Prediction>));
using (XmlWriter xmlWriter = XmlWriter.Create(stream, x_W_Settings))
data.Add(new Prediction() { description = App.professionalId });
list_locationAdd.ItemsSource = data;
serializer.Serialize(xmlWriter, data);
protected override void OnNavigatedTo(NavigationEventArgs e)
try
if (list_locationAdd != null)
using (IsolatedStorageFile ISF = IsolatedStorageFile.GetUserStoreForApplication())
using (IsolatedStorageFileStream str = ISF.OpenFile(filename, FileMode.Open))
XmlSerializer serializer = new XmlSerializer(typeof(ObservableCollection<Prediction>));
ObservableCollection<Prediction> data = (ObservableCollection<Prediction>)serializer.Deserialize(str);
if (list_locationAdd != null)
this.list_locationAdd.ItemsSource = data;
list_locationAdd.Visibility = Visibility.Visible;
catch (Exception ex)

Can you provide a working sample?  Upload to Onedrive and share it with us.
Matt Small - Microsoft Escalation Engineer - Forum Moderator
If my reply answers your question, please mark this post as answered.
NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
objects and unknown namespaces.

Similar Messages

  • Windows Phone 8.1 update error on Samsung Ativ S

    Windows Phone 8.1 update error on Samsung Ativ S.
    Last update dont Work on my phone, the phone start update but start agen and make error, can you help me?
    Can´t link ? Body text cannot contain images or links until we are able to verify your account.
    Can send a mail or link and you can see image off the error.

    We have moved our support forum for the OS Consumer Support (almost any support of the Preview for Developer
    release that is not related to developing an application and or MDM implemtation) to the Microsoft Community website. (http://answers.microsoft.com/en-us/winphone/forum/wpdp )

  • Windows Phone 8.1 Update 2

    Microsoft is on a roll.  According to WPCentral it looks like members of the developer preview program will see Update 2 released to their devices around 10/8/2014.
    List of unconfirmed features:
    The ability to create groups of applications in the application list
    Sorting options in the Settings
    File manager application becomes a system, so as to be able to use other applications
    The ability to change the default messages application
    News communications - DLNA, WiFi Direct, Bluetooth Profiles
    Source: Windows Phone 8.1 Update 2 features purportedly detailed, due in October plus Cortana for Poland | Windows Phone Central
    And we're still waiting for 8.1  

    If you look at the Nokia windows 8.1 availability site you'll notice all CDMA Carriers are listed as still Under Test.
    Microsoft shows Under Test to mean anything (carrier testing, MS testing, FCC testing, etc.).
    The fact that ALL CDMA Carriers are Under Test tells me that other than developer edition for beta feedback, Microsoft has not yet released the final 8.1 update (nor its Cyan update to 8.1) to any of these carriers.
    IMHO there may also be a gag agreement in reseller contracts preventing carriers from publicizing that they are still waiting on Microsoft to release the final version for these carriers to finally test, which would explain why NONE of the CDMA Carriers have answered any inquiries into 8.1 availability.
    So as much as I like to hold carriers accountable and even file complaints with the FCC when appropriate, reality is this might all be on Microsoft and the carriers may be as helpless as we are.

  • I can't update my ipad2 to ios5. After 2 hours and what looks like download complete and the start of processing, it stops with message check network settings and connections. Any ideas?

    I can't update my ipad2 to ios5. After 2 hours of what looks like a successful download and processing is about to begin, I lose connection and get message network timed out check network settings and connection, but I am still connected via wifi. Any ideas?

    If you are using windows...
    Try temporarily disabling your firewall and antivirus software and try again...
    See here for Connection Issues
    http://support.apple.com/kb/TS1379
    From Here
    http://www.apple.com/support/itunes/troubleshooting/

  • How can I update my iPad 3 to iOS 6 using iTunes

    How can I update my iPad 3 to iOS 6 using iTunes

    Welcome to the Apple Support Communities
    See "Update your device using iTunes" > http://support.apple.com/kb/HT4623?viewlocale=en_US&locale=en_US

  • I changed my itunes password only and now I can't update any of the apps I downloaded using the old password. I tried signing in with the old password with no luck. Can someone help please?

    I changed my itunes password only and now I can't update any of the apps I downloaded using the old password. I tried signing in with the old password with no luck. Can someone help please?

    Have you signed out of your iTunes account on the device/computer that you are using and signed back in with the updated password ? That should 'refresh' the account on it, and you should be able to use the account's new password to download updates to its apps

  • HT4972 I am using iphone 4 Geveya in which I have to dial 112 after re-insertion of Sim Card. When i connect my phn to I tunes I got message to update the version of iphone. Some one has informed me that I can not update this phn will stop workin after up

    I am using iphone 4 Geveya in which I have to dial 112 after re-insertion of Sim Card. When i connect my phn to I tunes I got message to update the version of iphone. Some one has informed me that I can not update this phn will stop workin after update.
    Kindly update me on this whether I need to update this or not.

    Try a Hard Reset.....
    Press and hold the Wake / Sleep button AND the Home button at the same time, keep them both pressed until the Apple Logo appears on the screen, it can take 10 or more seconds.  Ignore the swipe to turn off message.

  • How to update the value in xml file using transformer after setNodeValue

    Hi,
    This is my code
    I want to set update the values in xml file using transformer..
    Any one can help me
    This is my Xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <place>
    <name>chennai</name>
    </place>
    Jsp Page
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ page import="javax.xml.parsers.DocumentBuilderFactory,
    javax.xml.parsers.DocumentBuilder,org.w3c.dom.*,org.w3c.dom.Element"
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <% String str="";
    String str1="";
    try
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.parse("http://localhost:8084/XmlApplication1/sss.xml");
    out.println("Before change");
    NodeList n11 = doc.getElementsByTagName("name");
    Node n22= n11.item(0).getFirstChild();
    str1 = n22.getNodeValue();
    out.println(str1);
    out.println("After change");
    String name = "Banglore";
    NodeList nlst = doc.getElementsByTagName("name");
    Node node= nlst.item(0).getFirstChild();
    node.setNodeValue(name);
    NodeList n1 = doc.getElementsByTagName("name");
    Node n2= n1.item(0).getFirstChild();
    str = n2.getNodeValue();
    out.println(str);
    catch(Exception e)
    out.println(e) ;
    %>
    <h1><%=str%></h1>
    <%--
    This example uses JSTL, uncomment the taglib directive above.
    To test, display the page like this: index.jsp?sayHello=true&name=Murphy
    --%>
    <%--
    <c:if test="${param.sayHello}">
    <!-- Let's welcome the user ${param.name} -->
    Hello ${param.name}!
    </c:if>
    --%>
    </body>
    </html>

    hi check this exit...
    IWO10012

  • Can't open Numbers file after moving it back to Mac from Dropbox

    Please help!  Can't open Numbers file after moving it back to iMac from Dropbox.   Says I need the newer version of Numbers each time I tried to open the file.  I am 100% sure that I had the newest version.   Spoke to the AppleCare guy and after doing the checks he is also sure that I had the latest version of Numbers and AppleCare can't help.  He suggested that maybe i should run it on a file repair program...any suggestion?... please help...

    I've read reports of people having trouble when storing Numbers 3 documents on Dropbox.  I think it's related to the fact that they're not really "files."  They're "packages" that look like files. I had thought that Dropbox had cleared this up with their latest update. You should be on Dropbox version 2.4 or later.
    If you have Time Machine you may have some luck going back in time and restoring the document from a previous version.
    Storing Numbers documents on iCloud works much better, at least for me, and (unlike Dropbox) iCloud facilitates automatic syncing to other Macs and iOS devices signed into the same Apple ID.
    Perhaps you could consider keeping Numbers documents in iCloud instead. iCloud is deeply integrated into the app, and now works well.
    SG

  • Duplicates & triplicate Calendar items on my ipad after using the iCloud..

    i have duplicates Calendar items on my ipad after using the iCloud.. what am i doing wrong?? and how do i fix it?

    This solved my triplicate calendar issue:
    (short version)
    Settings ==> iCloud. Turn off Calenders.
    Delete exisiting calendar information when prompted.
    Settings ==> iCloud. Turn on Calenders.
    Restart Calender App.
    (verbose version)
    On your iOS devices go to Settings App ==> iCloud. Turn OFF Calendar Syncing. It will ask if you want to keep or delete previous Calendars on your phone, Choose Delete. Restart your Calendar app and see if it's squeaky clean. I had just birthdays and anniverseries. If you are still seeing items other than those (like birthdays) generated by the device then you are bringing in calendars from multiple sources. You'll need to turn off the other sources (if you have their entries duplicated already in the cloud).
    Now go back to Settings ==> iCloud and turn the calender back on. Restart the Calendar app, everything should look good now.

  • Private Window allows previously visited pages to be seen using the Back button.

    Private windows seem to be less private than non-Private windows:-
    1) In a Private Window the Back button allows previously visited pages to be determined.
    2) In a non-Private window Clear History removes previously visited pages (so that they aren't accessible using the Back button).
    3) Clear History (Ctrl-Shift-Delete) isn't available in Private windows.

    This can be a problem with the file places.sqlite that stores the bookmarks and the history.
    * http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox

  • Cannot use my back button on one site can click on pages

    When I load the main page it comes right up and if I click on sub pages they display but if I try to use the back button to go back they will not load. I have cleared cache and it does not help.

    ricknelson99 wrote:
    Since upgrading to Mavericks OS, I cannot use the back button to go to my original window.I deleted the Glims app. as mentioned on other posts, but it still doesn't work. Any other ideas or should I just move on to Firefox ?
    You can move on to Firefox if you wish, but you will still have an underlying problem with your OSX install if Safari is not working for you as it does for most everybody else.
    Apple Support Communities contributor etresoft wrote a very useful app to quickly gather certain system information that may help point to a cause of this problem. Go to his website, download and run EtreCheck:
    http://www.etresoft.com/etrecheck
    If you wish to troubleshoot your issue, you may wish to download it, run it and post the results back here.
    Cheers
    Pete

  • Can I delete the photos from my iPad after i have backed up in the iCloud?

    Can I delete the photos from my iPad after i have backed up in the iCloud?

    How much space is your Other using? You may be able to reduce.
    How Do I Get Rid Of The “Other” Data Stored On My iPad Or iPhone?
    http://tinyurl.com/85w6xwn
    With an iOS device, the “Other” space in iTunes is used to store things like documents, settings, caches, and a few other important items. If you sync lots of documents to apps like GoodReader, DropCopy, or anything else that reads external files, your storage use can skyrocket. With iOS 5, you can see exactly which applications are taking up the most space. Just head to Settings > General > Usage, and tap the button labeled Show All Apps. The storage section will show you the app and how much storage space it is taking up. Tap on the app name to get a description of the additional storage space being used by the app’s documents and data. You can remove the storage-hogging application and all of its data directly from this screen, or manually remove the data by opening the app. Some applications, especially those designed by Apple, will allow you to remove stored data by swiping from left to right on the item to reveal a Delete button.
     Cheers, Tom

  • How Can I Attach and Link an XML file to a 3D Model in a PDF?

    How Can I Attach and Link an XML file to a 3D Model in a PDF?
    What I am trying to do is find out how to have a 3D model and a parts list linked to it within the PDF file.  I would also like to be able to add to the parts list if at all possible once the pdf has been created.  A template to create future PDF's with the 3D model and list might also be useful.
    I am not entirely sure if this is all possible within a PDF file, but I have viewed a PDF (Adidas Trainer) example which has a Excel file attached to it which links to the 3D model.  I have also had a look at partner products such as Lattice, Tetra4D, Anark, which can do animations and all sorts, but frankly it seems a bit overkill for what I am looking to do.
    Please, any help would be appreciated.  Thanks

    AlliCT59 wrote:
    > Shared Object sounds like it would work, but hten agian,
    I'm really stuck!
    >
    > Thanks for any help.
    >
    > Allison
    I wrote about it while ago, let me paste the whole thing.
    This example has simple
    buttons which upon click go to new sites and in the same time
    place record in form
    of *.SOL file on user drive. That record is read when you hit
    the next button and
    based on that the button will be selected as the one last
    clicked.
    You could use the very same thing just instead of suppressing
    button simply gotoAndPlay frame
    to continue the part you need.
    http://groups.google.com/group/macromedia.flash.actionscript/browse_thread/thread/36649453 1f4fd02d/245a57d0cdaa1d29?lnk=st&q=&rnum=3&hl=en#245a57d0cdaa1d29
    The source is in a different place, i re-upload for you :
    http://www.flashfugitive.com/stuff/SharedObj_urlcheck/
    fla file
    http://www.flashfugitive.com/stuff/SharedObj_urlcheck/beentourl.fla
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • How can I recover an involuntarily  deleted keynote file after trash?

    After 3 days of working in Keynote I moved several files to my new 250gb hard disk. Many files were moved to trash and deleted. My work in keynote was lost and I have tried everything to recover it. Can you help me with this..? Is there a trick to recover a deletd file from trash...? Is there a recover-data file in my computer..? Thanks
    Unease

    How can I recover an involuntarily deleted keynote file after cleaning trash ..?

Maybe you are looking for

  • SQL Query report region that only queries on first load

    Hello all, Is there any way in which you can prevent a SQL Query report region from quering data after every refresh? I would like to make a report that queries on the first load, but then I would like to change the individual values, and reload to s

  • Change paper size.

         My scanner is set to letter; Acrobat only scans in legal and only shows "automatic" as a paper size option.  I want to scan in letter size as the default.   I have the full version of Acrobat X on Win 7 Ultimate, 64 bit

  • How can I do auto-sort-by-name

    In previous PSE(8/9/10), after change to folder view in EO, the files/Photo in folder selected will be sorted automatically by name, but I cannot sort by other methods (no [Sort By]). However, in PSE11, folder view has gone. I can sort by Newest, Old

  • Scoring music to picture in Logic, Help needed!!!!

    Hi all, I've been re-scoring some videos for a course I'm doing, and have a few questions concerning the "Export audio to movie" function. Is there a way to mute the original sound from the movie file, when exporting my music to the movie???? When l

  • My system is OSX version 10.5.8 2GHz PCG5 will I lose my mobileme

    I think my system is unable to up grade from mobileme to icloud, will I lose my mac email facility?