Exemple #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.
            var repo  = new TrainingRooms.RoomRepository();
            var rooms = repo.GetRooms();

            var source = new RoomsDatasource(rooms);

            this.TableView.Source = source;
        }
        public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender)
        {
            base.PrepareForSegue(segue, sender);

            if (segue.Identifier == "detailSegue")
            {
                RoomsDatasource source = this.TableView.Source as RoomsDatasource;
                var             room   = source.GetItem(this.TableView.IndexPathForSelectedRow.Row);
                var             target = segue.DestinationViewController as RoomDetailViewController;
                target.SetTrainingRoom(room);
            }
        }