Noob Xamarin/MonoTouch.Dialog question: I have laid out my iOS app in the storyboard designer of Xamarin Studio. I have a UINavigationController with a root view containing a UITableView with static cells, essentially creating a main menu. The cells segue to their respective UIViewControllers.
I want to layout the about/settings screen using MonoTouch.Dialog. However, I am running into some issues combining the overall storyboard approach with the partial MonoTouch.Dialogue approach due to my newbie-ness in Xamarin/MonoTouch.Dialog
When I instantiate a new DialogViewController on the UIViewController that got segued to from the initial UITableView (AccountViewController), I get essentially two views added to the navigation stack, the first only appearing briefly and then showing the DialogViewController. My code instantiating the DialogViewController is this:
partial class AccountViewController : UIViewController
{
public AccountViewController (IntPtr handle) : base (handle)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
var root = new RootElement ("Settings") {
new Section (){
new BooleanElement ("Airplane Mode", false),
new RootElement ("Notifications", 0, 0) {
new Section (null,
"Turn off Notifications to disable Sounds\n" +
"Alerts and Home Screen Badges for the\napplications below."){
new BooleanElement ("Notifications", false)
}
}}
};
var dialog = new DialogViewController (root, true);
this.NavigationController.PushViewController (dialog, true);
//this.NavigationController.PresentViewController (dialog, true, null); tried this but then the UINavigationController shows no back buttons
//View.AddSubview (dialog.View); tried this but then the UINavigationController shows no back buttons
}
}
I'm probably pushing the DialogViewController to late in the stack, creating the intermediary blank screen, but I can't figure out where the right place is to push the DialogViewController into the navigation stack given my current architecture. Most samples in the interwebs are nearly 100% MonoTouch.Dialog, no storyboard...
Thanks!