Inheritance: Danvy.ViewModels.ViewModelBase
コード例 #1
0
        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);


        }
コード例 #2
0
        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);

        }
コード例 #3
0
 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);
 }
コード例 #4
0
        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);
        }
コード例 #5
0
 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;
 }