private async void WorkTeamListView_ItemClick(object sender, ItemClickEventArgs e) { var game = new GameViewModel(); game.CreatedDate = DateTime.Now; game.UserIdCreator = UserViewModel.CurrentUser; game.UserIdOpponent = (e.ClickedItem as UserViewModel).UserPrincipalName; game = await GameHelper.Current.CreateGameAsync(game); AppShell.Current.Navigate(typeof(BoardView), game); }
private async void MarkovButton_Click(object sender, RoutedEventArgs e) { var game = new GameViewModel(); game.CreatedDate = DateTime.Now; game.UserIdCreator = UserViewModel.CurrentUser; game.UserIdOpponent = "*****@*****.**"; game = await GameHelper.Current.CreateGameAsync(game); AppShell.Current.Navigate(typeof(BoardView), game); }
private async void UserViewModel_ItemClick(object sender, ItemClickEventArgs e) { var user = e?.ClickedItem as UserViewModel; if (user == null) return; var game = new GameViewModel(); game.CreatedDate = DateTime.Now; game.UserIdCreator = UserViewModel.CurrentUser; game.UserIdOpponent = user.UserPrincipalName; game = await GameHelper.Current.CreateGameAsync(game); AppShell.Current.Navigate(typeof(BoardView), game); }
private async void ComputersListView_ItemClick(object sender, ItemClickEventArgs e) { var userViewModel = e?.ClickedItem as UserViewModel; var game = new GameViewModel(); game.CreatedDate = DateTime.Now; game.UserIdCreator = UserViewModel.CurrentUser; game.UserIdOpponent = userViewModel.Email; game = await GameHelper.Current.CreateGameAsync(game); AppShell.Current.Navigate(typeof(BoardView), game); }
private void Assign(GameViewModel game) { if (game == null) return; UserIdCreator = game.UserIdCreator; UserIdOpponent = game.UserIdOpponent; UserIdCurrent = game.UserIdCurrent; UserIdWinner = game.UserIdWinner; CreatedDate = game.CreatedDate; IsTerminated = game.IsTerminated; _InitialBoard = null; _Board = EMPTY_GAME; Board = game.Board; }