Exemplo n.º 1
0
        private async void ExecuteCreateGameCommand(object param)
        {
            NewGame       = new OneWayReference.Game();
            _dialogWindow = new CreateGame {
                DataContext = this
            };
            if (_dialogWindow.ShowDialog() == true)
            {
                /*OneWayReference.Game game = null;
                 * await Task.Run(() =>
                 * {
                 *  game = ServiceProxy.CreateGame(NewGame.Description, NewGame.PlayersCount, _userId);
                 * });
                 * if (game != null)
                 * {
                 *  var gameViewModel = new GameViewModel();
                 *  gameViewModel.Init();
                 * }*/
                await Task.Run(() =>
                {
                    DuplexProxy.CreateGame(_userId);
                });

                var gameViewModel = new GameViewModel();
                gameViewModel.Init();
            }
            ExecuteRefreshCommand(param);
        }