/// <summary>
        /// Does the initial data load of the table
        /// </summary>
        public void LoadTable()
        {
            AssociateTableView = new UITableView(new CoreGraphics.CGRect(0, 0, TableContainerView.Bounds.Width, TableContainerView.Bounds.Height));

            AssociateTableView.RegisterClassForCellReuse(typeof(MainCustomCell), nameof(MainCustomCell));

            AssociateTableView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            AssociateTableView.CellLayoutMarginsFollowReadableWidth = false;



            //generate our repository instance to access our list of users.

            //MainTableViewTableSource tableSource = new MainTableViewTableSource(list);

            AssociateTableView.TranslatesAutoresizingMaskIntoConstraints = false;


            var parentMargins = View.LayoutMarginsGuide;

            //AssociateTableView.Source = tableSource;
            TableContainerView.AddSubview(AssociateTableView);


            _currentTableViewController = _vm.UserCollection.GetController(CreatePersonCell, BindCellDelegate);

            _currentTableViewController.TableView = AssociateTableView;

            _currentTableViewController.GetViewForHeaderDelegate   = MainCustomCell.GetViewForHeader;
            _currentTableViewController.GetHeightForHeaderDelegate = MainCustomCell.GetHeightForHeader;

            _vm.LoadUserCollection();
        }
Пример #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            CollectionView.RegisterClassForCell(typeof(MyCardsCollectionViewCell), MyCardsCollectionViewCell.Key);
            CollectionView.WeakDataSource = new MyCardsCollectionViewDataSource();
            CollectionView.WeakDelegate   = new MyCardsCollectionViewDelegateFlowLayout();

            AddChildViewController(TableViewController);
            TableContainerView.AddSubview(TableViewController.View);
            TableContainerView.AddConstraint(NSLayoutConstraint.Create(TableViewController.View, NSLayoutAttribute.Top, NSLayoutRelation.Equal, TableContainerView, NSLayoutAttribute.Top, 1, 0));
            TableContainerView.AddConstraint(NSLayoutConstraint.Create(TableViewController.View, NSLayoutAttribute.Right, NSLayoutRelation.Equal, TableContainerView, NSLayoutAttribute.Right, 1, 0));
            TableContainerView.AddConstraint(NSLayoutConstraint.Create(TableViewController.View, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, TableContainerView, NSLayoutAttribute.Bottom, 1, 0));
            TableContainerView.AddConstraint(NSLayoutConstraint.Create(TableViewController.View, NSLayoutAttribute.Left, NSLayoutRelation.Equal, TableContainerView, NSLayoutAttribute.Left, 1, 0));

            ToggleCollectionViewVisibility(false, false);
        }