예제 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            if (UIDevice.CurrentDevice.CheckSystemVersion (7, 0))
                EdgesForExtendedLayout = UIRectEdge.None;

            services = DataLoader.LoadSampleData ();
            cells = new GridViewCell[services.Length];
            for (var col = 0; col < 2; col++) {
                for (var row = 0; row < 3; row++) {

                    var cell = new GridViewCell (new RectangleF (160 * col, 123 * row, 160, 123));

                    var index = col + row * 2;

                    Model service = services [index];

                    cell.Image = service.image;
                    cell.Caption = service.name;
                    cell.TouchUpInside += (sender, e) => {
                        selIndex = index;
                        PerformSegue ("detail", this);
                    };

                    cells [index] = cell;
                    View.AddSubview (cell);
                }
            }

            Xamarin.Themes.BizappTheme.Apply (View);
        }