Ejemplo n.º 1
0
		public override void AwakeFromNib ()
		{
			base.AwakeFromNib ();

			// Populate Source List
			SourceList.Initialize ();

			var TableViews = new SourceListItem ("Table Based Views");
			TableViews.AddItem ("Table View", "calendar.png", () => {
				DisplaySubview(new SubviewTableController(), SubviewType.TableView);
			});
			TableViews.AddItem ("Outline View", "calendar.png", () => {
				DisplaySubview(new SubviewOutlineController(), SubviewType.OutlineView);
			});
			SourceList.AddItem (TableViews);

			var ImageViews = new SourceListItem ("Photos");
			ImageViews.AddItem ("First Person", "film-roll.png", () => {
				if (ViewType== SubviewType.ImageView) {
					var Photo = Subview as SubviewImage ;
					Photo.Image = NSImage.ImageNamed("person01.jpg");
				} else {
					var Photo = new SubviewImageController();
					Photo.View.Image = NSImage.ImageNamed("person01.jpg");
					DisplaySubview(Photo, SubviewType.ImageView);
				}
			});
			ImageViews.AddItem ("Second Person", "film-roll.png", () => {
				if (ViewType== SubviewType.ImageView) {
					var Photo = Subview as SubviewImage ;
					Photo.Image = NSImage.ImageNamed("person02.jpg");
				} else {
					var Photo = new SubviewImageController();
					Photo.View.Image = NSImage.ImageNamed("person02.jpg");
					DisplaySubview(Photo, SubviewType.ImageView);
				}
			});
			ImageViews.AddItem ("Third Person", "film-roll.png", () => {
				if (ViewType== SubviewType.ImageView) {
					var Photo = Subview as SubviewImage ;
					Photo.Image = NSImage.ImageNamed("person03.jpg");
				} else {
					var Photo = new SubviewImageController();
					Photo.View.Image = NSImage.ImageNamed("person03.jpg");
					DisplaySubview(Photo, SubviewType.ImageView);
				}
			});
			SourceList.AddItem (ImageViews);

			// Display Source List
			SourceList.ReloadData();
			SourceList.ExpandItem (null, true);
		}
Ejemplo n.º 2
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            // Populate Source List
            SourceList.Initialize();

            var TableViews = new SourceListItem("Table Based Views");

            TableViews.AddItem("Table View", "calendar.png", () => {
                DisplaySubview(new SubviewTableController(), SubviewType.TableView);
            });
            TableViews.AddItem("Outline View", "calendar.png", () => {
                DisplaySubview(new SubviewOutlineController(), SubviewType.OutlineView);
            });
            SourceList.AddItem(TableViews);

            var ImageViews = new SourceListItem("Photos");

            ImageViews.AddItem("First Person", "film-roll.png", () => {
                if (ViewType == SubviewType.ImageView)
                {
                    var Photo   = Subview as SubviewImage;
                    Photo.Image = NSImage.ImageNamed("person01.jpg");
                }
                else
                {
                    var Photo        = new SubviewImageController();
                    Photo.View.Image = NSImage.ImageNamed("person01.jpg");
                    DisplaySubview(Photo, SubviewType.ImageView);
                }
            });
            ImageViews.AddItem("Second Person", "film-roll.png", () => {
                if (ViewType == SubviewType.ImageView)
                {
                    var Photo   = Subview as SubviewImage;
                    Photo.Image = NSImage.ImageNamed("person02.jpg");
                }
                else
                {
                    var Photo        = new SubviewImageController();
                    Photo.View.Image = NSImage.ImageNamed("person02.jpg");
                    DisplaySubview(Photo, SubviewType.ImageView);
                }
            });
            ImageViews.AddItem("Third Person", "film-roll.png", () => {
                if (ViewType == SubviewType.ImageView)
                {
                    var Photo   = Subview as SubviewImage;
                    Photo.Image = NSImage.ImageNamed("person03.jpg");
                }
                else
                {
                    var Photo        = new SubviewImageController();
                    Photo.View.Image = NSImage.ImageNamed("person03.jpg");
                    DisplaySubview(Photo, SubviewType.ImageView);
                }
            });
            SourceList.AddItem(ImageViews);

            // Display Source List
            SourceList.ReloadData();
            SourceList.ExpandItem(null, true);
        }