locked
Problem with suspending my app

    Question

  • I have spent days trying to get my head round suspensionmanager and navigation manager. I thought I had done everything and am using both as advised but all does not work. My app is a card game with MainPage used as menu and second page to play the game. If I suspend and shut down when the card pack has been placed on the screen it comes back to that no problem. However I deal the cards to the players and try again and it just goes back to the pack at the beginning. Is it in fact possible to save the position of cards that have been moved and played all over the place.

    Maybe I should just to stick to what I was doing in the past which was to save all data between hands so that they come back to main page menu and play the next hand with all saved?

    Thank you for any advice,

    Malcolm Bain


    Malcolm Bain

    Friday, September 12, 2014 3:02 PM

Answers

  • Yes. You need to add code to save the positions. It is not automatic. You probably have code or markup with the initial position so you'll get that as a default.
    • Marked as answer by Malcnoo Friday, September 12, 2014 4:07 PM
    Friday, September 12, 2014 3:36 PM
    Owner

All replies

  • Yes. You can and should save the state when suspending. The suspension manager provides tools for this, but doesn't automatically do the save for you.
    Friday, September 12, 2014 3:12 PM
    Owner
  • Thank you, I understand that, what I do not understand is that I seem to have everything for it to come back if I do a suspend and close just after the game has started - it comes back with the cards in a heap to deal. However if I try to do the same after a deal it still comes back to the original pack in the middle and not the cards dealt. Do I need to add something to the code after every movement of a card or cards? Why would it save the cards initially but not after they have moved?

    Thank you

    Malcolm Bain

     

    Malcolm Bain

    Friday, September 12, 2014 3:28 PM
  • Yes. You need to add code to save the positions. It is not automatic. You probably have code or markup with the initial position so you'll get that as a default.
    • Marked as answer by Malcnoo Friday, September 12, 2014 4:07 PM
    Friday, September 12, 2014 3:36 PM
    Owner