C# UWP how to create a save file -


so new , need guidance, have app(tichu counter) in app have controls , events happening handle.

now here part.
before navigating page of app tricks count people's scores want create page. in page have 2 options 1 "new game" , "resume game". problem don't know how save values , how call them @ resume game.

i have 2 listviews show class score.each team gets value show, lista listview of team a, listb listview of team b.

// listview knows changed. private observablecollection<score> scores; //on page load scores = new observablecollection<score>();  // how add scores inside score class //teamascore , teambscore scores user has typed inside //the 2 textboxes have(shown in picture below) scores.add(new score { lista = teamascore, listb = teambscore });  public class score {     public int lista { get; set; }     public int listb { get; set; } } 

with lists have 2 textblocks 1 team , 1 team b. located above each listview , show overall score of team shown in picture (http://prntscr.com/akavl6).

one thing if close page , reopen class , ofc textblocks wont hold values had. , pretty don't know how go save somewhere lists , overall scores can restore them when go page or delete them , start new game values 0.

saving values local storage want. if single values can store assigning them string variable in local storage.
suggest incorporate sqlite database. since dealing 2 listviews assuming data keeps on increasing exponentially better save data in database other in .txt file in local storage or creating new variables each entry.
though time consuming , lot more code needed save user data in better format.
though there options of using static data or parameter passing while navigating lead loss of data once app session ends, app closes.


Comments