Пример #1
0
 public AddUserVM()
 {
     MessagingCenter.Subscribe <AddUserPopup, string>(this, "AddUser", async(obj, nameUser) =>
     {
         User newUser = new User(nameUser, 0, DeviceInfo.Model);
         await User_DataStore.AddUser(newUser);
         await PopupNavigation.Instance.PopAsync();
         MainPageVM abc = new MainPageVM();
         abc.NewGameCmd.Execute(null);
     });
 }
Пример #2
0
        public OutGameVM(int UScore)
        {
            MakeNewGame = new Command(() =>
            {
                MainPageVM abc = new MainPageVM();
                abc.NewGameCmd.Execute(null);
            });
            MainPage = new Command(async() =>
            {
                await Application.Current.MainPage.Navigation.PopToRootAsync();
            });


            Device.BeginInvokeOnMainThread(async() =>
            {
                User upUser  = await User_DataStore.CheckDeviceAsync(DeviceInfo.Model);
                upUser.score = UScore;
                await User_DataStore.UpdateUser(upUser);
            });
        }