private async void GetPlayersFromDB() { P1 = await App.LocalDB.GetPlayerByID(1); P2 = await App.LocalDB.GetPlayerByID(2); if (P1 == null) { P1 = new PlayerLP { ID = 1, Value = 8000 }; await App.LocalDB.SaveItemAsync <PlayerLP>(P1); } if (P2 == null) { P2 = new PlayerLP { ID = 2, Value = 8000 }; await App.LocalDB.SaveItemAsync <PlayerLP>(P2); } LP1 = P1.Value; LP2 = P2.Value; RaisePropertyChanged(nameof(LP1)); RaisePropertyChanged(nameof(LP2)); }
async private void SaveValue(PlayerLP player) { await App.LocalDB.SaveItemAsync <PlayerLP>(player); }