예제 #1
0
        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));
        }
예제 #2
0
 async private void SaveValue(PlayerLP player)
 {
     await App.LocalDB.SaveItemAsync <PlayerLP>(player);
 }