Пример #1
0
			public MainView(MainViewController parent)
			{
				BackgroundColor = UIColor.White;
				backgroundImageView = new UIImageView(UIImage.FromBundle("background"));
				AddSubview(backgroundImageView);

				logoImageView = new UIImageView(new RectangleF(20, 40, 150, 45))
				{
					Image = UIImage.FromBundle("logo_mainhub"),
					ContentMode = UIViewContentMode.ScaleAspectFit,
				};
				AddSubview(logoImageView);

				nextVisitView = new NextVisitView();
				nextVisitView.TouchUpInside += (sender, args) => Parent.ShowVisitDetails(nextVisitView.Visit);
				AddSubview(nextVisitView);

				otherVisitFlipper = new VisitFlipper {Selected = visit => Parent.ShowVisitDetails(visit)};
				AddSubview(otherVisitFlipper);

				todayVisitsViewController = new VisitsViewController
				{
					Title = "Today's Visits",
					Selected = visit => Parent.ShowVisitDetails(visit)
				};
				AddSubview(todayVisitsViewController.View);
				parent.AddChildViewController(todayVisitsViewController);
			}
            public MainView(MainViewController parent)
            {
                BackgroundColor     = UIColor.White;
                backgroundImageView = new UIImageView(UIImage.FromBundle("background"));
                AddSubview(backgroundImageView);

                logoImageView = new UIImageView(new RectangleF(20, 40, 150, 45))
                {
                    Image       = UIImage.FromBundle("logo_mainhub"),
                    ContentMode = UIViewContentMode.ScaleAspectFit,
                };
                AddSubview(logoImageView);

                nextVisitView = new NextVisitView();
                nextVisitView.TouchUpInside += (sender, args) => Parent.ShowVisitDetails(nextVisitView.Visit);
                AddSubview(nextVisitView);

                otherVisitFlipper = new VisitFlipper {
                    Selected = visit => Parent.ShowVisitDetails(visit)
                };
                AddSubview(otherVisitFlipper);

                todayVisitsViewController = new VisitsViewController
                {
                    Title    = "Today's Visits",
                    Selected = visit => Parent.ShowVisitDetails(visit)
                };
                AddSubview(todayVisitsViewController.View);
                parent.AddChildViewController(todayVisitsViewController);
            }