Exemple #1
0
        void SetUpUI()
        {
            Title = new CultureInfo("en-US").TextInfo.ToTitleCase(viewModel.Name);
            NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(UIImage.FromFile("NavigationBar_Back.png"), UIBarButtonItemStyle.Plain, (sender, args) => { NavigationController.PopViewController(true); }), true);

            btnCheckIn.Layer.CornerRadius  = 4;
            btnCheckIn.Layer.MasksToBounds = true;

            headerView = BeerDescriptionHeaderView.Create();
            headerView.SetBeer(viewModel.Beer);
            tableView.TableHeaderView = null;
            tableView.AddSubview(headerView);
            tableView.ContentInset    = new UIEdgeInsets(headerViewHeight, 0, 0, 0);
            tableView.BackgroundColor = UIColor.Clear;

            //Add Cells
            AddRating();
            AddDescription();

            //Update Tableview
            tableView.Source = new BeerDescriptionDataSource(ref cells);
            var deleg = new DescriptionDelegate(ref cells);

            deleg.DidScroll   += UpdateHeaderView;
            tableView.Delegate = deleg;

            tableView.ReloadData();
            View.SetNeedsDisplay();
        }
        void SetUpUI ()
        {
            Title = new CultureInfo ("en-US").TextInfo.ToTitleCase (viewModel.Name);
            NavigationItem.SetLeftBarButtonItem (new UIBarButtonItem (UIImage.FromFile ("NavigationBar_Back.png"), UIBarButtonItemStyle.Plain, (sender, args) => {NavigationController.PopViewController (true);}), true);

            btnCheckIn.Layer.CornerRadius = 4;
            btnCheckIn.Layer.MasksToBounds = true;

            headerView = BeerDescriptionHeaderView.Create();
            headerView.SetBeer(viewModel.Beer);
            tableView.TableHeaderView = null;
            tableView.AddSubview (headerView);
            tableView.ContentInset = new UIEdgeInsets (headerViewHeight, 0, 0, 0);
            tableView.BackgroundColor = UIColor.Clear;

            //Add Cells
            AddRating();
            AddDescription ();

            //Update Tableview
            tableView.Source = new BeerDescriptionDataSource(ref cells);
            var deleg = new DescriptionDelegate (ref cells);
            deleg.DidScroll += UpdateHeaderView;
            tableView.Delegate = deleg;

            tableView.ReloadData ();
            View.SetNeedsDisplay ();
        }