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); }); }
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); }); }