Skip to content

Instantly share code, notes, and snippets.

@darbio
Created June 22, 2012 06:37
Show Gist options
  • Save darbio/2970806 to your computer and use it in GitHub Desktop.
Save darbio/2970806 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 MyDialogViewController () {
TabBarItem = new UITabBarItem ("Tab 1", Image, 0)
},
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