Created
June 22, 2012 02:31
-
-
Save darbio/2969865 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override void ViewWillAppear (bool animated) | |
{ | |
base.ViewWillAppear (animated); | |
BeginInvokeOnMainThread (delegate () { | |
this.Root = CreateRoot (); | |
}); | |
} | |
RootElement CreateRoot () | |
{ | |
this.Root = new RootElement ("Root") { | |
CreateSection_Items () | |
} | |
} | |
Section CreateSection_Items () | |
{ | |
// Set up the section | |
var itemsSection = new Section (string.Format ("Items ({0})", iSession.Unique.Materials.Count)); // iSession.Unique is a Singleton | |
// Add the elements to the section | |
itemsSection.AddAll (CreateElements_Items ()); | |
return itemsSection; | |
} | |
List <Element> CreateElements_Items () | |
{ | |
var itemElements = new List<Element> (); | |
foreach (var material in iSession.Unique.Materials) { | |
itemElements.Add (new Element (material.Description)); | |
} | |
return itemElements; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment