async void NavigateToEndPage() { currentGame.FirstPlayerId = App.UserId; currentGame.FirstPlayerScore = score; var response = await HttpService.GetResult(Constants.uri + path + "getResults/" + currentGame.GameId, currentGame); FinalScoreModel finalScore = new FinalScoreModel(); if (response.StatusCode == HttpStatusCode.OK) { var data = await response.Content.ReadAsStringAsync(); var MongoResponse = JObject.Parse(data); finalScore.currentUser = MongoResponse["currentUser"].ToString(); string temp1; string temp2; temp1 = MongoResponse["currentUserScore"].ToString(); finalScore.otherUser = MongoResponse["otherUser"].ToString(); temp2 = MongoResponse["otherUserScore"].ToString(); finalScore.currentUserScore = int.Parse(temp1); finalScore.otherUserScore = int.Parse(temp2); } Application.Current.MainPage = new FinalScore(finalScore); }
public FinalScore(FinalScoreModel finalScore) { InitializeComponent(); BindingContext = new ViewModelScore(finalScore); }