Exemple #1
0
        public void setvalue1(int index)
        {
            foreach (UIView sub in this.Subviews)
            {
                if (sub == content)
                {
                    sub.RemoveFromSuperview();
                }
            }
            content.RemoveFromSuperview();
            content = new UIView(new CGRect(0, 0, this.Frame.Width, this.Frame.Height));
            if (index == 0)
            {
                headerContentLabel.Text = "Home";
                content.BackgroundColor = UIColor.White;

                textBlockLabel1               = new UILabel();
                textBlockLabel1.Frame         = new CGRect(15, 10, content.Frame.Width - 20, 300);
                textBlockLabel1.Text          = "Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum tempus. Turpis facilisis vitae consequat, cum a a, turpis dui consequat massa in dolor per, felis non amet. Auctor eleifend in omnis elit vestibulum, donec non elementum tellus est mauris, id aliquam, at lacus, arcu pretium proin lacus dolor et. Eu tortor, vel ultrices amet dignissim mauris vehicula. Lorem tortor neque, purus taciti quis id. Elementum integer orci accumsan minim phasellus vel.";
                textBlockLabel1.LineBreakMode = UILineBreakMode.WordWrap;
                textBlockLabel1.TextAlignment = UITextAlignment.Justified;
                textBlockLabel1.Lines         = 0;
                textBlockLabel1.Font          = UIFont.FromName("Helvetica", 15f);
                content.AddSubview(textBlockLabel1);
            }
            else if (index == 1)
            {
                headerContentLabel.Text = "Profile";
                content.BackgroundColor = UIColor.White;
                UILabel usernameLabel = new UILabel();
                usernameLabel.Frame         = new CGRect((this.Frame.Width / 2), 20, 200, 30);
                usernameLabel.Text          = "James Pollock";
                usernameLabel.TextAlignment = UITextAlignment.Left;
                content.AddSubview(usernameLabel);
                UILabel userageLabel = new UILabel();
                userageLabel.Frame         = new CGRect((this.Frame.Width / 2), 45, 200, 30);
                userageLabel.Text          = "Age 30";
                userageLabel.Font          = UIFont.FromName("Helvetica", 18f);
                userageLabel.TextAlignment = UITextAlignment.Left;
                content.AddSubview(userageLabel);
                UILabel emptyLabel = new UILabel();
                emptyLabel.Frame           = new CGRect(10, 120, this.Frame.Width - 20, 1);
                emptyLabel.BackgroundColor = UIColor.Gray;
                content.AddSubview(emptyLabel);
                UIImageView userImgLabel = new UIImageView();
                userImgLabel.Frame = new CGRect((this.Frame.Width / 2) - 100, 10, 80, 80);
                userImgLabel.Image = new UIImage("Images/User.png");

                content.Add(userImgLabel);
                UILabel commentLabel = new UILabel();
                commentLabel.Frame = new CGRect(20, 130, this.Frame.Width - 40, 200);
                commentLabel.Text  = "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout." +
                                     " The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters. \n\nWhen looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters." +
                                     "\n\n James Pollock";
                commentLabel.Font          = UIFont.FromName("Helvetica", 15f);
                commentLabel.LineBreakMode = UILineBreakMode.WordWrap;
                commentLabel.Lines         = 0;
                content.AddSubview(commentLabel);
            }
            else if (index == 2)
            {
                headerContentLabel.Text = "Inbox";
                maintable = new UITableView(new CGRect(0, 0, this.Frame.Width, this.Frame.Height));                   // defaults to Plain style
                if ((UIDevice.CurrentDevice).UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
                {
                    tableItems   = new string[] { "John", "Caster", "Joey", "Xavier", "Gonzalez", "Rodriguez", "Ruben", "Keven", "Walton" };
                    contentItems = new string[]
                    { "Hi John, See you at 7AM", "Hi Caster, See you at 9AM", "Hi Joey, See you at 11AM", "Hi Xavier, See you at 12PM", "Hi Gonzalez, See you at 1PM", "Hi Rodriguez, See you at 2PM",
                      "Hi Ruben, See you at 4PM", "Hi Keven, See you at 5PM", "Hi Walton, See you at 7PM" };
                }
                else
                {
                    tableItems   = new string[] { "John", "Caster", "Joey", "Xavier", "Gonzalez", "Rodriguez", "Ruben" };
                    contentItems = new string[] { "Hi John, See you at 10AM", "Hi Caster, See you at 11AM", "Hi Joey, See you at 1PM", "Hi Xavier, See you at 2PM", "Hi Gonzalez, See you at 3PM", "Hi Rodriguez, See you at 4PM",
                                                  "Hi Ruben, See you at 6PM" };
                }
                TableSource tablesource = new TableSource(tableItems, contentItems);
                tablesource.customise = true;
                maintable.Source      = tablesource;
                content.Add(maintable);
            }
            else if (index == 3)
            {
                headerContentLabel.Text = "Outbox";
                maintable = new UITableView(new CGRect(0, 0, this.Frame.Width, this.Frame.Height));                   // defaults to Plain style
                if ((UIDevice.CurrentDevice).UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
                {
                    tableItems   = new string[] { "John", "Caster", "Joey", "Xavier", "Gonzalez", "Rodriguez", "Ruben", "Keven", "Walton" };
                    contentItems = new string[]
                    { "Hi John, See you at 7AM", "Hi Caster, See you at 9AM", "Hi Joey, See you at 11AM", "Hi Xavier, See you at 12PM", "Hi Gonzalez, See you at 1PM", "Hi Rodriguez, See you at 2PM",
                      "Hi Ruben, See you at 4PM", "Hi Keven, See you at 5PM", "Hi Walton, See you at 7PM" };
                }
                else
                {
                    tableItems   = new string[] { "John", "Caster", "Joey", "Xavier", "Gonzalez", "Rodriguez", "Ruben" };
                    contentItems = new string[] { "Hi John, See you at 10AM", "Hi Caster, See you at 11AM", "Hi Joey, See you at 1PM", "Hi Xavier, See you at 2PM", "Hi Gonzalez, See you at 3PM", "Hi Rodriguez, See you at 4PM",
                                                  "Hi Ruben, See you at 6PM" };
                }
                TableSource tablesource = new TableSource(tableItems, contentItems);
                tablesource.customise = true;
                maintable.Source      = tablesource;
                content.Add(maintable);
            }
            else if (index == 4)
            {
                headerContentLabel.Text = "Sent";
                maintable = new UITableView(new CGRect(0, 0, this.Frame.Width, this.Frame.Height));                   // defaults to Plain style
                if ((UIDevice.CurrentDevice).UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
                {
                    tableItems   = new string[] { "John", "Caster", "Joey", "Xavier", "Gonzalez", "Rodriguez", "Ruben", "Keven", "Walton" };
                    contentItems = new string[]
                    { "Hi John, See you at 7AM", "Hi Caster, See you at 9AM", "Hi Joey, See you at 11AM", "Hi Xavier, See you at 12PM", "Hi Gonzalez, See you at 1PM", "Hi Rodriguez, See you at 2PM",
                      "Hi Ruben, See you at 4PM", "Hi Keven, See you at 5PM", "Hi Walton, See you at 7PM" };
                }
                else
                {
                    tableItems   = new string[] { "John", "Caster", "Joey", "Xavier", "Gonzalez", "Rodriguez", "Ruben" };
                    contentItems = new string[] { "Hi John, See you at 10AM", "Hi Caster, See you at 11AM", "Hi Joey, See you at 1PM", "Hi Xavier, See you at 2PM", "Hi Gonzalez, See you at 3PM", "Hi Rodriguez, See you at 4PM",
                                                  "Hi Ruben, See you at 6PM" };
                }
                TableSource tablesource = new TableSource(tableItems, contentItems);
                tablesource.customise = true;
                maintable.Source      = tablesource;
                content.Add(maintable);
            }
            else if (index == 5)
            {
                headerContentLabel.Text = "Trash";
                maintable = new UITableView(new CGRect(0, 0, this.Frame.Width, this.Frame.Height));                   // defaults to Plain style
                if ((UIDevice.CurrentDevice).UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
                {
                    tableItems   = new string[] { "John", "Caster", "Joey", "Xavier", "Gonzalez", "Rodriguez", "Ruben", "Keven", "Walton" };
                    contentItems = new string[]
                    { "Hi John, See you at 7AM", "Hi Caster, See you at 9AM", "Hi Joey, See you at 11AM", "Hi Xavier, See you at 12PM", "Hi Gonzalez, See you at 1PM", "Hi Rodriguez, See you at 2PM",
                      "Hi Ruben, See you at 4PM", "Hi Keven, See you at 5PM", "Hi Walton, See you at 7PM" };
                }
                else
                {
                    tableItems   = new string[] { "John", "Caster", "Joey", "Xavier", "Gonzalez", "Rodriguez", "Ruben" };
                    contentItems = new string[] { "Hi John, See you at 10AM", "Hi Caster, See you at 11AM", "Hi Joey, See you at 1PM", "Hi Xavier, See you at 2PM", "Hi Gonzalez, See you at 3PM", "Hi Rodriguez, See you at 4PM",
                                                  "Hi Ruben, See you at 6PM" };
                }
                TableSource tablesource = new TableSource(tableItems, contentItems);
                tablesource.customise = true;
                maintable.Source      = tablesource;
                content.Add(maintable);
            }
            background.Add(content);
        }
        public override void LayoutSubviews()
        {
            //NavigationDrawer initialize
            sideMenuController = new SFNavigationDrawer();
            mainView           = new MainPageView(this.Frame);
            UIButton menubutton = new UIButton();

            menubutton.Frame = new CGRect(10, 10, 30, 30);
            menubutton.SetBackgroundImage(new UIImage("Images/menu.png"), UIControlState.Normal);
            mainView.AddSubview(menubutton);

            sideMenuController.ContentView = mainView;
            if ((UIDevice.CurrentDevice).UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                sideMenuController.DrawerWidth = (this.Bounds.Width * 40) / 100;
            }
            else
            {
                sideMenuController.DrawerWidth = (this.Bounds.Width * 60) / 100;
            }

            sideMenuController.DrawerHeight = this.Bounds.Height;
            mainView.Frame = new CGRect(0, 0, this.Bounds.Width, this.Bounds.Height);

            //Menu Page Design
            table      = new UITableView(new CGRect(0, 0, sideMenuController.DrawerWidth, this.Frame.Height));        // defaults to Plain style
            tableItems = new string[] { "Home", "Profile", "Inbox", "Outbox", "Sent Items", "Trash" };
            TableSource tablesource = new TableSource(tableItems);

            tablesource.customise      = false;
            table.Source               = tablesource;
            this.BackgroundColor       = UIColor.FromRGB(63, 134, 246);
            HeaderView                 = new UIView();
            HeaderView.Frame           = new CGRect(0, 0, sideMenuController.DrawerWidth, 100);
            HeaderView.BackgroundColor = UIColor.FromRGB(49, 173, 225);
            UIView centerview = new UIView();

            centerview.Frame = new CGRect(0, 100, sideMenuController.DrawerWidth, 500);
            centerview.Add(table);
            usernameLabel               = new UILabel();
            usernameLabel.Frame         = new CGRect(0, 70, sideMenuController.DrawerWidth, 30);
            usernameLabel.Text          = "James Pollock";
            usernameLabel.TextColor     = UIColor.White;
            usernameLabel.TextAlignment = UITextAlignment.Center;
            HeaderView.AddSubview(usernameLabel);

            userImg       = new UIImageView();
            userImg.Frame = new CGRect((sideMenuController.DrawerWidth / 2) - 25, 15, 50, 50);
            userImg.Image = new UIImage("Images/User.png");

            HeaderView.AddSubview(userImg);

            sideMenuController.DrawerHeaderView  = HeaderView;
            sideMenuController.DrawerContentView = centerview;
            sideMenuController.Position          = SFNavigationDrawerPosition.SFNavigationDrawerPositionLeft;

            this.AddSubview(sideMenuController);


            menubutton.TouchDown += (object sender, System.EventArgs e) =>
            {
                sideMenuController.ToggleDrawer();
            };



            foreach (var view in this.Subviews)
            {
                sideMenuController.Frame = new CGRect(0, 0, this.Frame.Width, this.Frame.Height);
                positionLabel.Frame      = new CGRect(this.Frame.X + 10, 0, PopoverSize.Width - 20, 30);
                positionbutton.Frame     = new CGRect(this.Frame.X + 10, 40, PopoverSize.Width - 20, 30);
                transitionLabel.Frame    = new CGRect(this.Frame.X + 10, 90, PopoverSize.Width - 20, 30);
                transitionbutton.Frame   = new CGRect(this.Frame.X + 10, 130, PopoverSize.Width - 20, 30);
                selectionPicker1.Frame   = new CGRect(0, PopoverSize.Height / 2, PopoverSize.Width, PopoverSize.Height / 3);
                selectionPicker2.Frame   = new CGRect(0, PopoverSize.Height / 2, PopoverSize.Width, PopoverSize.Height / 3);
                doneButton.Frame         = new CGRect(0, PopoverSize.Height / 2.5, PopoverSize.Width, 40);
            }
            this.optionView();
        }
        public void setvalue1(int index)
        {
            foreach (UIView sub in this.Subviews)
            {
                if (sub == content)
                {
                    sub.RemoveFromSuperview();
                }
            }
            content.RemoveFromSuperview();
            content = new UIView(new CGRect(0, 0, this.Frame.Width, this.Frame.Height));
            if (index == 0)
            {
                header.Text = "Home";
                nfloat width  = ((this.Frame.Width) - 30) / 2;
                nfloat height = (this.Frame.Height - 100) / 3;
                content.BackgroundColor = UIColor.White;
                img1 = new UIButton();
                img1.SetBackgroundImage(new UIImage("Images/profile.png"), UIControlState.Normal);
                img1.Frame          = new CGRect(10, 10, width, height);
                img1.TouchUpInside += ShowSelection;
                content.AddSubview(img1);
                img2 = new UIButton();
                img2.SetBackgroundImage(new UIImage("Images/outbox.png"), UIControlState.Normal);
                img2.Frame          = new CGRect(10, height + 20, width, height);
                img2.TouchUpInside += ShowSelection;
                content.AddSubview(img2);
                img3 = new UIButton();
                img3.SetBackgroundImage(new UIImage("Images/trash.png"), UIControlState.Normal);
                img3.Frame          = new CGRect(10, (height * 2) + 30, width, height);
                img3.TouchUpInside += ShowSelection;
                content.AddSubview(img3);
                img4 = new UIButton();
                img4.SetBackgroundImage(new UIImage("Images/inbox.png"), UIControlState.Normal);
                img4.Frame          = new CGRect(20 + width, 10, width, height);
                img4.TouchUpInside += ShowSelection;
                content.AddSubview(img4);
                img5 = new UIButton();
                img5.SetBackgroundImage(new UIImage("Images/sentitem.png"), UIControlState.Normal);
                img5.Frame          = new CGRect(20 + width, height + 20, width, height);
                img5.TouchUpInside += ShowSelection;
                content.AddSubview(img5);
                img6 = new UIButton();
                img6.SetBackgroundImage(new UIImage("Images/power.png"), UIControlState.Normal);
                img6.Frame          = new CGRect(20 + width, (height * 2) + 30, width, height);
                img6.TouchUpInside += ShowSelection;
                content.AddSubview(img6);
            }
            else if (index == 1)
            {
                header.Text             = "Profile";
                content.BackgroundColor = UIColor.White;
                UILabel lbe = new UILabel();
                lbe.Frame         = new CGRect((this.Frame.Width / 2) + 20, 20, 200, 30);
                lbe.Text          = "James Pollock";
                lbe.TextAlignment = UITextAlignment.Left;
                content.AddSubview(lbe);
                UILabel lbe1 = new UILabel();
                lbe1.Frame         = new CGRect((this.Frame.Width / 2) + 20, 45, 200, 30);
                lbe1.Text          = "Age 30";
                lbe1.Font          = UIFont.FromName("Helvetica", 18f);
                lbe1.TextAlignment = UITextAlignment.Left;
                content.AddSubview(lbe1);
                UILabel lbe3 = new UILabel();
                lbe3.Frame           = new CGRect(10, 120, this.Frame.Width - 20, 1);
                lbe3.BackgroundColor = UIColor.Gray;
                content.AddSubview(lbe3);
                UIImageView imageview = new UIImageView();
                imageview.Frame = new CGRect((this.Frame.Width / 2) - 80, 10, 80, 80);
                imageview.Image = new UIImage("Images/User.png");

                content.Add(imageview);
                UILabel cnt = new UILabel();
                cnt.Frame = new CGRect(20, 130, this.Frame.Width - 40, 200);
                cnt.Text  = "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout." +
                            " The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters. \n\nWhen looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters." +
                            "\n\n James Pollock";
                cnt.Font          = UIFont.FromName("Helvetica", 15f);
                cnt.LineBreakMode = UILineBreakMode.WordWrap;
                cnt.Lines         = 0;
                content.AddSubview(cnt);
            }
            else if (index == 2)
            {
                header.Text  = "Inbox";
                maintable    = new UITableView(new CGRect(0, 0, this.Frame.Width, this.Frame.Height));                // defaults to Plain style
                tableItems   = new string[] { "John", "Caster", "Joey", "Xavier", "Gonzalez", "Rodriguez", "Ruben" };
                contentItems = new string[] { "Hi John, See you at 10AM", "Hi Caster, See you at 11AM", "Hi Joey, See you at 1PM", "Hi Xavier, See you at 2PM", "Hi Gonzalez, See you at 3PM", "Hi Rodriguez, See you at 4PM",
                                              "Hi Ruben, See you at 6PM" };
                TableSource sc = new TableSource(tableItems, contentItems);
                sc.customise     = true;
                maintable.Source = sc;
                content.Add(maintable);
            }
            else if (index == 3)
            {
                header.Text  = "Outbox";
                maintable    = new UITableView(new CGRect(0, 0, this.Frame.Width, this.Frame.Height));                // defaults to Plain style
                tableItems   = new string[] { "Ruben", "Rodriguez", "Gonzalez", "Xavier", "Joey", "Caster", "John" };
                contentItems = new string[] { "Hi Ruben, See you at 6PM", "Hi Rodriguez, See you at 4PM", "Hi Gonzalez, See you at 3PM", "Hi Xavier, See you at 2PM", "Hi Joey, See you at 1PM", "Hi Caster, See you at 11AM",
                                              "Hi John, See you at 10AM" };
                TableSource sc = new TableSource(tableItems, contentItems);
                sc.customise     = true;
                maintable.Source = sc;
                content.Add(maintable);
            }
            else if (index == 4)
            {
                header.Text  = "Sent";
                maintable    = new UITableView(new CGRect(0, 0, this.Frame.Width, this.Frame.Height));                // defaults to Plain style
                tableItems   = new string[] { "Gonzalez", "Rodriguez", "Ruben", "John", "Caster", "Joey", "Xavier" };
                contentItems = new string[] { "Hi Gonzalez, See you at 3PM", "Hi Rodriguez, See you at 4PM", "Hi Ruben, See you at 6PM", "Hi John, See you at 10AM", "Hi Caster, See you at 11AM", "Hi Joey, See you at 1PM",
                                              "Hi Xavier, See you at 2PM" };
                TableSource sc = new TableSource(tableItems, contentItems);
                sc.customise     = true;
                maintable.Source = sc;
                content.Add(maintable);
            }
            else if (index == 5)
            {
                header.Text  = "Trash";
                maintable    = new UITableView(new CGRect(0, 0, this.Frame.Width, this.Frame.Height));                // defaults to Plain style
                tableItems   = new string[] { "Xavier", "Joey", "Caster", "John", "Gonzalez", "Rodriguez", "Ruben" };
                contentItems = new string[] { "Hi Xavier, See you at 2PM", "Hi Joey, See you at 1PM", "Hi , See you at 11AM", "Hi John, See you at 10AM", "Hi Gonzalez, See you at 3PM", "Hi Rodriguez, See you at 4PM",
                                              "Hi Ruben, See you at 6PM" };
                TableSource sc = new TableSource(tableItems, contentItems);
                sc.customise     = true;
                maintable.Source = sc;
                content.Add(maintable);
            }
            background.Add(content);
        }
		public override void LayoutSubviews ()
		{

			//NavigationDrawer initialize
			sideMenuController = new SFNavigationDrawer ();
			mainView = new MainPageView(this.Frame);
			UIButton bn=new UIButton();
			bn.Frame =new CGRect (10, 10, 30, 30);
			bn.SetBackgroundImage (new UIImage ("Images/menu.png"), UIControlState.Normal);
			mainView.AddSubview (bn);

			sideMenuController.ContentView = mainView;
			if((UIDevice.CurrentDevice).UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
			{
				sideMenuController.DrawerWidth = (this.Bounds.Width*40)/100;
			}
			else
				sideMenuController.DrawerWidth = (this.Bounds.Width*60)/100;

			sideMenuController.DrawerHeight = this.Bounds.Height;
			mainView.Frame = new CGRect (0, 0, this.Bounds.Width, this.Bounds.Height);

			//Menu Page Design
			table = new UITableView(new CGRect(0, 0, sideMenuController.DrawerWidth, this.Frame.Height)); // defaults to Plain style
			tableItems = new string[] {"Home","Profile","Inbox","Outbox","Sent Items","Trash"};
			TableSource sc = new TableSource(tableItems);
			sc.customise = false;
			table.Source = sc;
			this.BackgroundColor = UIColor.FromRGB(63,134,246);
			HeaderView = new UIView ();
			HeaderView.Frame = new CGRect (0, 0, sideMenuController.DrawerWidth, 100);
			HeaderView.BackgroundColor = UIColor.FromRGB (49, 173, 225);
			UIView centerview = new UIView ();
			centerview.Frame = new CGRect (0, 100, sideMenuController.DrawerWidth, 500);
			centerview.Add (table);
			lbe = new UILabel ();
			lbe.Frame =new CGRect (0, 70, sideMenuController.DrawerWidth, 30);
			lbe.Text="James Pollock";
			lbe.TextColor = UIColor.White;
			lbe.TextAlignment = UITextAlignment.Center;
			HeaderView.AddSubview (lbe);

			imageview=new UIImageView();
			imageview.Frame =new CGRect ((sideMenuController.DrawerWidth/2)-25, 15, 50, 50);
			imageview.Image = new UIImage ("Images/User.png");

			HeaderView.AddSubview (imageview);

			sideMenuController.DrawerHeaderView = HeaderView;
			sideMenuController.DrawerContentView = centerview;
			sideMenuController.Position = SFNavigationDrawerPosition.SFNavigationDrawerPositionLeft;

			this.AddSubview (sideMenuController.View);


			bn.TouchDown+= (object sender, System.EventArgs e) => 
			{
				sideMenuController.ToggleDrawer();

			};



			foreach (var view in this.Subviews) {


				label3.Frame = new CGRect (this.Frame.X +10, this.Frame.Y-20, this.Frame.Size.Width - 20, 30);
				textbutton.Frame=new CGRect(this.Frame.X +10, this.Frame.Y+20, this.Frame.Size.Width - 20, 30);	
				label4.Frame = new CGRect (this.Frame.X +10, this.Frame.Y+60, this.Frame.Size.Width - 20, 30);
				textbutton1.Frame=new CGRect(this.Frame.X +10, this.Frame.Y+100, this.Frame.Size.Width - 20, 30);	
				picker1.Frame = new CGRect (0, this.Frame.Size.Height-(this.Frame.Size.Height/3), this.Frame.Size.Width, this.Frame.Size.Height/3);
				picker2.Frame = new CGRect (0, this.Frame.Size.Height-(this.Frame.Size.Height/3), this.Frame.Size.Width , this.Frame.Size.Height/3);
				doneButton.Frame = new CGRect (0, this.Frame.Size.Height-(this.Frame.Size.Height/3), this.Frame.Size.Width, 30);
			}


		}
		public void setvalue1(int index)
		{
			foreach(UIView sub in this.Subviews)
			{
				if(sub==content)
				sub.RemoveFromSuperview();
			}
			content.RemoveFromSuperview ();
			content =new UIView(new CGRect(0,0,this.Frame.Width,this.Frame.Height));
			if (index == 0) {
				header.Text = "Home";
				nfloat width = ((this.Frame.Width)-30) / 2;
				nfloat height = (this.Frame.Height-100) /3;
				content.BackgroundColor = UIColor.White;
				img1 = new UIButton ();
				img1.SetBackgroundImage (new UIImage ("Images/profile.png"), UIControlState.Normal);
				img1.Frame = new CGRect (10, 10, width, height);
				img1.TouchUpInside += ShowSelection;
				content.AddSubview (img1);
				img2 = new UIButton ();
				img2.SetBackgroundImage (new UIImage ("Images/outbox.png"), UIControlState.Normal);
				img2.Frame = new CGRect (10, height+20, width, height);
				img2.TouchUpInside += ShowSelection;
				content.AddSubview (img2);
				img3 = new UIButton ();
				img3.SetBackgroundImage (new UIImage ("Images/trash.png"), UIControlState.Normal);
				img3.Frame = new CGRect (10, (height*2)+30, width, height);
				img3.TouchUpInside += ShowSelection;
				content.AddSubview (img3);
				img4 = new UIButton ();
				img4.SetBackgroundImage (new UIImage ("Images/inbox.png"), UIControlState.Normal);
				img4.Frame = new CGRect (20+width, 10, width, height);
				img4.TouchUpInside += ShowSelection;
				content.AddSubview (img4);
				img5 = new UIButton ();
				img5.SetBackgroundImage (new UIImage ("Images/sentitem.png"), UIControlState.Normal);
				img5.Frame = new CGRect (20+width, height+20, width, height);
				img5.TouchUpInside += ShowSelection;
				content.AddSubview (img5);
				img6 = new UIButton ();
				img6.SetBackgroundImage (new UIImage ("Images/power.png"), UIControlState.Normal);
				img6.Frame = new CGRect (20+width, (height*2)+30, width, height);
				img6.TouchUpInside += ShowSelection;
				content.AddSubview (img6);
			}
			else if (index == 1) {
				header.Text = "Profile";
				content.BackgroundColor = UIColor.White;
				UILabel lbe = new UILabel ();
				lbe.Frame =new CGRect ((this.Frame.Width/2)+20, 20, 200, 30);
				lbe.Text="James Pollock";
				lbe.TextAlignment = UITextAlignment.Left;
				content.AddSubview (lbe);
				UILabel lbe1 = new UILabel ();
				lbe1.Frame =new CGRect ((this.Frame.Width/2)+20, 45, 200, 30);
				lbe1.Text="Age 30";
				lbe1.Font = UIFont.FromName ("Helvetica", 18f);
				lbe1.TextAlignment = UITextAlignment.Left;
				content.AddSubview (lbe1);
				UILabel lbe3 = new UILabel ();
				lbe3.Frame =new CGRect (10, 120, this.Frame.Width-20, 1);
				lbe3.BackgroundColor = UIColor.Gray;
				content.AddSubview (lbe3);
				UIImageView imageview=new UIImageView();
				imageview.Frame =new CGRect ((this.Frame.Width/2)-80, 10, 80, 80);
				imageview.Image = new UIImage ("Images/User.png");

				content.Add (imageview);
				UILabel cnt = new UILabel ();
				cnt.Frame =new CGRect (20, 130, this.Frame.Width-40, 200);
				cnt.Text="It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout." +
					" The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters. \n\nWhen looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters." +
					"\n\n James Pollock";
				cnt.Font = UIFont.FromName ("Helvetica", 15f);
				cnt.LineBreakMode = UILineBreakMode.WordWrap;
				cnt.Lines = 0;
				content.AddSubview (cnt);

			}else if (index == 2) {
				header.Text = "Inbox";
				maintable = new UITableView (new CGRect (0, 0, this.Frame.Width, this.Frame.Height)); // defaults to Plain style
				tableItems = new string[] { "John", "Caster", "Joey", "Xavier", "Gonzalez", "Rodriguez", "Ruben" };
				contentItems = new string[] {"Hi John, See you at 10AM", "Hi Caster, See you at 11AM", "Hi Joey, See you at 1PM", "Hi Xavier, See you at 2PM", "Hi Gonzalez, See you at 3PM", "Hi Rodriguez, See you at 4PM",
					"Hi Ruben, See you at 6PM"
				};
				TableSource sc = new TableSource (tableItems, contentItems);
				sc.customise = true;
				maintable.Source = sc;
				content.Add (maintable);

			} else if (index == 3) {
				header.Text = "Outbox";
				maintable = new UITableView (new CGRect (0, 0, this.Frame.Width, this.Frame.Height)); // defaults to Plain style
				tableItems = new string[] { "Ruben", "Rodriguez", "Gonzalez", "Xavier", "Joey", "Caster", "John" };
				contentItems = new string[] {"Hi Ruben, See you at 6PM", "Hi Rodriguez, See you at 4PM", "Hi Gonzalez, See you at 3PM", "Hi Xavier, See you at 2PM", "Hi Joey, See you at 1PM", "Hi Caster, See you at 11AM",
					"Hi John, See you at 10AM"
				};
				TableSource sc = new TableSource (tableItems, contentItems);
				sc.customise = true;
				maintable.Source = sc;
				content.Add (maintable);
			}else if (index == 4) {
				header.Text = "Sent";
				maintable = new UITableView (new CGRect (0, 0, this.Frame.Width, this.Frame.Height)); // defaults to Plain style
				tableItems = new string[] { "Gonzalez", "Rodriguez", "Ruben", "John", "Caster", "Joey", "Xavier"};
				contentItems = new string[] {"Hi Gonzalez, See you at 3PM", "Hi Rodriguez, See you at 4PM", "Hi Ruben, See you at 6PM", "Hi John, See you at 10AM", "Hi Caster, See you at 11AM", "Hi Joey, See you at 1PM",
					"Hi Xavier, See you at 2PM"
				};
				TableSource sc = new TableSource (tableItems, contentItems);
				sc.customise = true;
				maintable.Source = sc;
				content.Add (maintable);
			}
			else if (index == 5) {
				header.Text = "Trash";
				maintable = new UITableView (new CGRect (0, 0, this.Frame.Width, this.Frame.Height)); // defaults to Plain style
				tableItems = new string[] { "Xavier", "Joey", "Caster", "John", "Gonzalez", "Rodriguez", "Ruben" };
				contentItems = new string[] {"Hi Xavier, See you at 2PM", "Hi Joey, See you at 1PM", "Hi , See you at 11AM", "Hi John, See you at 10AM", "Hi Gonzalez, See you at 3PM", "Hi Rodriguez, See you at 4PM",
					"Hi Ruben, See you at 6PM"
				};
				TableSource sc = new TableSource (tableItems, contentItems);
				sc.customise = true;
				maintable.Source = sc;
				content.Add (maintable);
			}
			background.Add(content);
		}