Skip to content

Instantly share code, notes, and snippets.

@taktamur
Created August 26, 2014 14:30
Show Gist options
  • Save taktamur/0cefd75097f951dd9e6b to your computer and use it in GitHub Desktop.
Save taktamur/0cefd75097f951dd9e6b to your computer and use it in GitHub Desktop.
Xamarinで遊ぶ(2) DialogViewController ref: http://qiita.com/paming/items/025ff5d39ed3abd113db
Root = new RootElement(){
new Section(){..},
new Section(){..},
}
Root = new RootElement ("HomeScreen");
var section1 = new Section ("First Section");
section1.Add (new StringElement ("Hello", () => {
new UIAlertView ("Hola", "Thanks for tapping!", null, "Continue").Show ();
}));
section1.Add (new EntryElement ("Name", "Enter your name", String.Empty));
Root.Add (section1);
Root.Add (new Section ("Second Section"));
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.Dialog;
namespace MyTasky.Screens
{
public partial class HomeViewController : DialogViewController
{
public HomeViewController () : base (UITableViewStyle.Grouped, null)
{
Root = new RootElement ("HomeScreen"){
new Section ("First Section") {
new StringElement ("Hello", () => {
new UIAlertView ("Hola", "Thanks for tapping!", null, "Continue").Show ();
}),
new EntryElement ("Name", "Enter your name", String.Empty)
},
new Section ("Second Section") {
},
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment