// This method is invoked when the application has loaded its UI and its ready to run public override bool FinishedLaunching(UIApplication app, NSDictionary options) { load(); string[] s; mainMenu = new Section("Blogs", "Click for a new Account"); for(int i = 0; i < titles.Count; i++){ s = titles.ElementAt(i); var a = new Account( s[0], s[1], s[2] ); accounts.Add( a ); a.SetDelegate(this); mainMenu.Add( a.GetRoot() ); } var nb = new StringElement("new Account", NewBlog); nb.Alignment = UITextAlignment.Center; mainMenu.Add( nb ); var dv = new ExtDialogViewController ( new RootElement("Blogs"){ mainMenu } ) { Autorotate = true, DisableUpsideDown = true }; window.AddSubview (navigation.View); navigation.PushViewController (dv, true); window.MakeKeyAndVisible (); return true; }
public void NewBlog() { var a = new Account(); accounts.Add( a ); var s = new string[]{ a.Name, a.URL, a.Login }; titles.Add(s); a.SetDelegate(this); mainMenu.Insert( mainMenu.Count-1, a.GetRoot() ); navigation.PushViewController ( a.getDVC(null), true); }