public override void ViewDidLoad () { base.ViewDidLoad (); // Populate Source List SourceList.Initialize (); var TableViews = new SourceListItem ("Data Binding Type"); TableViews.AddItem ("Simple Binding", "shoebox.png", () => { ViewType = SubviewType.SimpleBinding; PerformSegue("SimpleSegue", this); }); TableViews.AddItem ("Table Binding", "shoebox.png", () => { ViewType = SubviewType.TableBinding; PerformSegue("TableSegue", this); }); TableViews.AddItem ("Outline Binding", "shoebox.png", () => { ViewType = SubviewType.OutlineBinging; PerformSegue("OutlineSegue", this); }); TableViews.AddItem ("Collection View", "shoebox.png", () => { ViewType = SubviewType.CollectionView; PerformSegue("CollectionSegue", this); }); SourceList.AddItem (TableViews); // Display Source List SourceList.ReloadData(); SourceList.ExpandItem (null, true); }
public override void AwakeFromNib () { base.AwakeFromNib (); // Populate Source List SourceList.Initialize (); var TableViews = new SourceListItem ("Control Type"); TableViews.AddItem ("Buttons", "tag.png", () => { DisplaySubview(SubviewType.Buttons); }); TableViews.AddItem ("Checkboxes & Radio Buttons", "tag.png", () => { DisplaySubview(SubviewType.CheckAndRadioButtons); }); TableViews.AddItem ("Menu Controls", "tag.png", () => { DisplaySubview(SubviewType.MenuControls); }); TableViews.AddItem ("Selection Controls", "tag.png", () => { DisplaySubview(SubviewType.SelectionControls); }); TableViews.AddItem ("Indicator Controls", "tag.png", () => { DisplaySubview(SubviewType.IndicatorControls); }); TableViews.AddItem ("Text Controls", "tag.png", () => { DisplaySubview(SubviewType.TextControls); }); TableViews.AddItem ("Content Views", "tag.png", () => { DisplaySubview(SubviewType.ContentViews); }); SourceList.AddItem (TableViews); // Display Source List SourceList.ReloadData(); SourceList.ExpandItem (null, true); }
public override void ViewDidLoad () { base.ViewDidLoad (); // Populate Source List SourceList.Initialize (); var TableViews = new SourceListItem ("Table Based Views"); TableViews.AddItem ("Table View", "calendar.png", () => { PerformSegue("TableSegue", this); }); TableViews.AddItem ("Outline View", "calendar.png", () => { PerformSegue("OutlineSegue", this); }); SourceList.AddItem (TableViews); var ImageViews = new SourceListItem ("Photos"); ImageViews.AddItem ("First Person", "film-roll.png", () => { Picture = NSImage.ImageNamed("person01.jpg"); PerformSegue("PictureSegue", this); }); ImageViews.AddItem ("Second Person", "film-roll.png", () => { Picture = NSImage.ImageNamed("person02.jpg"); PerformSegue("PictureSegue", this); }); ImageViews.AddItem ("Third Person", "film-roll.png", () => { Picture = NSImage.ImageNamed("person03.jpg"); PerformSegue("PictureSegue", this); }); SourceList.AddItem (ImageViews); // Display Source List SourceList.ReloadData(); SourceList.ExpandItem (null, true); }
/// <summary> /// Adds the item. /// </summary> /// <param name="item">Item.</param> public void AddItem(SourceListItem item) { if (Data != null) { Data.Items.Add(item); } }
/// <summary> /// Raises the item selected. /// </summary> /// <param name="item">Item.</param> internal void RaiseItemSelected(SourceListItem item) { // Inform caller if (this.ItemSelected != null) { this.ItemSelected(item); } }
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); }
public override void AwakeFromNib () { base.AwakeFromNib (); // Get access to database DatabaseConnection = GetDatabaseConnection (); // Wire-up controls AddButton.Active = false; AddButton.Activated += (sender, e) => { // Take action based on type switch(ViewType) { case SubviewType.TableBinding: var controller = SubviewController as SubviewTableBindingController; var person = new PersonModel("Unknown","Unknown"); var sheet = new PersonEditorSheetController(person, true); // Wire-up sheet.PersonModified += (p) => { // Save person to database p.Create(DatabaseConnection); controller.AddPerson(p); }; // Display sheet sheet.ShowSheet(this); break; case SubviewType.CollectionView: var collection = SubviewController as SubviewCollectionViewController; var collectionPerson = new PersonModel("Unknown","Unknown"); var collectionSheet = new PersonEditorSheetController(collectionPerson, true); // Wire-up collectionSheet.PersonModified += (p) => { // Save person to database p.Create(DatabaseConnection); collection.AddPerson(p); }; // Display sheet collectionSheet.ShowSheet(this); break; } }; EditButton.Active = false; EditButton.Activated += (sender, e) => { // Take action based on type switch(ViewType) { case SubviewType.TableBinding: var controller = SubviewController as SubviewTableBindingController; controller.EditPerson(this); break; case SubviewType.CollectionView: var collection = SubviewController as SubviewCollectionViewController; collection.EditPerson(this); break; } }; DeleteButton.Active = false; DeleteButton.Activated += (sender, e) => { // Take action based on type switch(ViewType) { case SubviewType.TableBinding: var controller = SubviewController as SubviewTableBindingController; controller.DeletePerson(this); break; case SubviewType.CollectionView: var collection = SubviewController as SubviewCollectionViewController; collection.DeletePerson(this); break; } }; Search.Enabled = false; Search.EditingEnded += (sender, e) => { // Take action based on type switch(ViewType) { case SubviewType.TableBinding: var controller = SubviewController as SubviewTableBindingController; controller.FindPerson(Search.StringValue); break; case SubviewType.CollectionView: var collection = SubviewController as SubviewCollectionViewController; collection.FindPerson(Search.StringValue); break; } }; // Populate Source List SourceList.Initialize (); var TableViews = new SourceListItem ("Direct SQLite"); TableViews.AddItem ("Simple Binding", "shoebox.png", () => { DisplaySubview(new SubviewSimpleBindingController(DatabaseConnection), SubviewType.SimpleBinding); }); TableViews.AddItem ("Table Binding", "shoebox.png", () => { DisplaySubview(new SubviewTableBindingController(DatabaseConnection), SubviewType.TableBinding); }); TableViews.AddItem ("Outline Binding", "shoebox.png", () => { DisplaySubview(new SubviewOutlineBindingController(DatabaseConnection), SubviewType.OutlineBinging); }); TableViews.AddItem ("Collection View", "shoebox.png", () => { DisplaySubview(new SubviewCollectionViewController(DatabaseConnection), SubviewType.CollectionView); }); SourceList.AddItem (TableViews); var ORMViews = new SourceListItem ("SQLite.Net ORM"); ORMViews.AddItem ("Table Binding", "shoebox.png", () => { DisplaySubview(new SubviewTableORMController(), SubviewType.TableORM); }); SourceList.AddItem (ORMViews); // Display Source List SourceList.ReloadData(); SourceList.ExpandItem (null, true); }
/// <summary> /// Removes the item. /// </summary> /// <param name="item">Item.</param> public void RemoveItem(SourceListItem item) { _items.Remove (item); }
/// <summary> /// Insert the specified n and item. /// </summary> /// <param name="n">N.</param> /// <param name="item">Item.</param> public void Insert(int n, SourceListItem item) { _items.Insert (n, item); }
/// <summary> /// Adds the item. /// </summary> /// <param name="item">Item.</param> public void AddItem(SourceListItem item) { _items.Add (item); }
/// <summary> /// Removes the item. /// </summary> /// <param name="item">Item.</param> public void RemoveItem(SourceListItem item) { _items.Remove(item); }
/// <summary> /// Insert the specified n and item. /// </summary> /// <param name="n">N.</param> /// <param name="item">Item.</param> public void Insert(int n, SourceListItem item) { _items.Insert(n, item); }
/// <summary> /// Adds the item. /// </summary> /// <param name="item">Item.</param> public void AddItem(SourceListItem item) { _items.Add(item); }
/// <summary> /// Adds the item. /// </summary> /// <param name="item">Item.</param> public void AddItem(SourceListItem item) { if (Data != null) { Data.Items.Add (item); } }
/// <summary> /// Raises the item selected. /// </summary> /// <param name="item">Item.</param> internal void RaiseItemSelected(SourceListItem item) { // Inform caller if (this.ItemSelected != null) { this.ItemSelected (item); } }