GlassButton
がクリックされたときに画面を変更する方法を探しています。Monotouch.Dialog の学習を始めたばかりです。これを試して処理するために、次のことを行いました。
public override void ViewDidLoad ()
{
button.TouchUpInside += (sender, e) => {
this.NavigationController.PushViewController(list, true);
};
}
list は ですUIViewController
が、クリックthis.NavigationController.PushViewController(list, true);
すると null 参照例外で指されます。 list
はインスタンス化されており、null ではありませんが、this.NavigationController
null です。どうすればこれを修正できますか?
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
}
}
}
};
}