public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            // Perform any additional setup after loading the view, typically from a nib.
            _games = new List<TableItemGroup>();
            _activeGames = new ActiveGamesTableSource(_games);
            GamesTable.Source = _activeGames;
            Add (GamesTable);

            FetchGames();

            _activeGames.GameClicked += (gameId) => {
                var gameView = new GameViewController(gameId);
                this.NavigationController.PushViewController(gameView, true);
            };
        }
partial         void CreateClicked(NSObject sender)
        {
            var gameId = Guid.NewGuid();
            var gameName = "Mono Game "+ gameId.ToString().Substring(0, 5);
            AddGame(gameId,gameName);

            var gameView = new GameViewController(gameId);
            this.NavigationController.PushViewController(gameView, true);
        }
Ejemplo n.º 3
0
 void JoinGame(string gameId)
 {
     var asyncDelegation = new AsyncDelegation(restService);
     asyncDelegation.Post("joingame", new {gameId = gameId, playerId = Application.PlayerId, playerName = "Mono Touch"})
         .WhenFinished(()=> {
             var gameView = new GameViewController(gameId);
             this.NavigationController.PushViewController(gameView, true);
         });
     asyncDelegation.Go();
 }