I am looking for a way to change screens when the GlassButton
is clicked. I have just started learning Monotouch.Dialog. I have done the following to try and handle this.
public override void ViewDidLoad ()
{
button.TouchUpInside += (sender, e) => {
this.NavigationController.PushViewController(list, true);
};
}
list is a UIViewController
, but on click, this.NavigationController.PushViewController(list, true);
is pointed to with a null reference exception. list
has been instantiated and is not null, however, this.NavigationController
is null. How can I fix this?
GlassButton button = new GlassButton (new RectangleF(0, 0, 200, 50));
List list = new List ();
public static EntryElement lastName = new EntryElement (null, "Enter Last Name", null);
public static EntryElement firstName = new EntryElement (null, "Enter First Name", null);
public static EntryElement middleInitial = new EntryElement (null, "Enter Middle Initial", null);
public practice () : base (UITableViewStyle.Grouped, null)
{
Root = new RootElement ("Level 1") {
new Section() {
new RootElement("Level 2") {
new Section("Individual Information") {
lastName, firstName, middleInitial
},
new Section("Submit") {
button
}
}
}
};
}