Esempio n. 1
0
        public void SetGameList(IList <GameViewModel> games)
        {
            InvokeOnMainThread(() => {
                this.games      = games;
                var newRoot     = new RootElement("Games");
                var mainSection = new Section(MyGamesViewModel.GetGameTypeDescription(ListType));
                newRoot.Add(mainSection);

                StringElement ele = new StringElement("ABC", () => {
                    Console.WriteLine("String clicked");
                });
                // mainSection.Add(ele);
                // mainSection.Add(new UIViewElement("", new UILabel(new RectangleF(0, 0, 100, 100)) { Text = "ABCDEFEFDF"}, false));
                foreach (var game in this.games)
                {
                    var cell = TestTVC.Create();

                    cell.SetData(game);
                    var customelement = new CustomView(cell);
                    mainSection.Add(customelement);
                }

                Root = this.rootElement = newRoot;
            });
        }
Esempio n. 2
0
        /// <summary>
        /// Called by the TableView to get the actual UITableViewCell to render for the particular section and row
        /// </summary>
        public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            Console.WriteLine("Calling Get Cell, isEditing:" + tableView.Editing);

            var game = this.tableItems [indexPath.Row];

            var cell = tableView.DequeueReusableCell(this.cellIdentifier) as TestTVC;

            if (cell == null)
            {
                cell = TestTVC.Create();
            }
            cell.SetData(game);

            return(cell);
        }