Skip to content

Instantly share code, notes, and snippets.

@Clancey
Forked from darbio/gist:2970806
Created June 22, 2012 06:57
Show Gist options
  • Save Clancey/2970868 to your computer and use it in GitHub Desktop.
Save Clancey/2970868 to your computer and use it in GitHub Desktop.
class MyTabBarController () : UITabBarController
{
public MyTabBarController () : base ()
{
}
public override void ViewWillAppear (bool animated)
{
base.ViewWillAppear (animated);
var tabBarControllers = new UIViewController[] {
new UINavigationController(new MyDialogViewController () {
TabBarItem = new UITabBarItem ("Tab 1", Image, 0)
}),
new UINavigationController(new MyDialogViewController () {
TabBarItem = new UITabBarItem ("Tab 2", Image, 0)
})
};
this.SetViewControllers (tabBarControllers, true);
this.Title = "TabBarController Title";
}
}
class MyDialogViewController () : DialogViewController
{
public MyDialogViewController () : base (null)
{
}
public override void ViewWillAppear (bool animated)
{
this.Root = CreateRoot ();
}
RootElement CreateRoot ()
{
var root = new RootElement ("Root Element") {
new Section ("Radio Group") {
CreateRoot_RadioSelections ()
}
};
return root;
}
RootElementWithEvents CreateRoot_RadioSelections ()
{
// Populate the elements
var radioGroup = new RadioGroup (0);
var section = new Section ();
for (int i = 0; i < 10; i++) {
section.Add (new RadioElement (i.ToString ()));
}
var element = new RootElementWithEvents("Delivery Priority", radioGroup) {
section
};
return element;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment