コード例 #1
0
		public void DemoRefresh ()
		{
			int i = 0;
			var root = new RootElement ("Pull to Refresh"){
				new Section () {
					new MultilineElement ("Pull from the top to add\na new item at the bottom\nThen wait 1 second")
				}
			};

			var dvc = new DialogViewController (root, true);
			
			//
			// After the DialogViewController is created, but before it is displayed
			// Assign to the RefreshRequested event.   The event handler typically
			// will queue a network download, or compute something in some thread
			// when the update is complete, you must call "ReloadComplete" to put
			// the DialogViewController in the regular mode
			//
			dvc.RefreshRequested += delegate {
				// Wait 3 seconds, to simulate some network activity
				NSTimer.CreateScheduledTimer (1, delegate {
					root [0].Add (new StringElement ("Added " + (++i)));
					
					// Notify the dialog view controller that we are done
					// this will hide the progress info
					dvc.ReloadComplete ();
				});
			};
			dvc.Style = UITableViewStyle.Plain;
			
			navigation.PushViewController (dvc, true);			
		}
コード例 #2
0
		public MainDialogViewController () : base (UITableViewStyle.Grouped, null)
		{
			float_element_original = new FloatElement(null, null, 0.8f);
			float_element_original_w_caption = new FloatElement(null, null, 0.8f)
			{
				Caption = "Desc"
			,	ShowCaption = true
			};
			float_element_modified_01 = new FloatElement("Modified 01")
			{
			};
			float_element_modified_02 = new FloatElement(0.2f, 0.9f, 0.5f)
			{
			};
			
			Root = new MonoMobile.Dialog.RootElement ("MainDialogViewController") {
				new MonoMobile.Dialog.Section ("First Section")
				{
				  float_element_original
				, float_element_original_w_caption
				, float_element_modified_01
				, float_element_modified_02
				}
			};
		}
コード例 #3
0
		public void DemoHeadersFooters () 
		{
			var section = new Section () { 
				HeaderView = new UIImageView (UIImage.FromFile ("caltemplate.png")),
				FooterView = new UISwitch (new RectangleF (0, 0, 80, 30)),
			};
			
			// Fill in some data 
			var linqRoot = new RootElement ("LINQ source"){
				from x in new string [] { "one", "two", "three" }
					select new Section (x) {
						from y in "Hello:World".Split (':')
							select (Element) new StringElement (y)
				}
			};

			section.Add ((Element) new RootElement ("Desert", new RadioGroup ("desert", 0)){
				new Section () {
					new RadioElement ("Ice Cream", "desert"),
					new RadioElement ("Milkshake", "desert"),
					new RadioElement ("Chocolate Cake", "desert")
				},
			});
			
			var root = new RootElement ("Headers and Footers") {
				section,
				new Section () { (Element) linqRoot }
			};
			var dvc = new DialogViewController (root, true);
			navigation.PushViewController (dvc, true);
		}
コード例 #4
0
		public RootElement(string caption, RootElement navigate_back)
			: this(caption)
		{
			//this.Add(new StringElement("Back", BackClicked));

			return;
		}
コード例 #5
0
		// Creates the dynamic content from the twitter results
		RootElement CreateDynamicContent (XDocument doc)
		{
			var users = doc.XPathSelectElements ("./statuses/status/user").ToArray ();
			var texts = doc.XPathSelectElements ("./statuses/status/text").Select (x=>x.Value).ToArray ();
			var people = doc.XPathSelectElements ("./statuses/status/user/name").Select (x=>x.Value).ToArray ();
			
			var section = new Section ();
			var root = new RootElement ("Tweets") { section };
			
			for (int i = 0; i < people.Length; i++){
				var line = new RootElement (people [i]) { 
					new Section ("Profile"){
						new StringElement ("Screen name", users [i].XPathSelectElement ("./screen_name").Value),
						new StringElement ("Name", people [i]),
						new StringElement ("oFllowers:", users [i].XPathSelectElement ("./followers_count").Value)
					},
					new Section ("Tweet"){
						new StringElement (texts [i])
					}
				};
				section.Add((Element) line);
			}
			
			return root;
		}
コード例 #6
0
		/*
			//--------------------------------------------------------------------------
			//
			// Create our UI and add it to the current toplevel navigation controller
			// this will allow us to have nice navigation animations.
			//
			var dv = new DialogViewController (menu) {
				Autorotate = true
			};
			navigation = new UINavigationController ();
			navigation.PushViewController (dv, true);				
			
			// On iOS5 we use the new window.RootViewController, on older versions, we add the subview
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			window.MakeKeyAndVisible ();
			if (UIDevice.CurrentDevice.CheckSystemVersion (5, 0))
				window.RootViewController = navigation;	
			else
				window.AddSubview (navigation.View);

		 * 
			//--------------------------------------------------------------------------
		 
			DialogAdapter da = new DialogAdapter(this, root);

			ListView lv = new ListView(this) {Adapter = da};

			SetContentView(lv);
			//--------------------------------------------------------------------------
		 
		
		 */

		public bool FinishedLaunchingFake ()
		{
			string p = "";
			var menu = new RootElement ("Demos"){
				new Section ("Element API"){
					new StringElement ("Element API HolisticWare", DemoElementApiHolisticWare),
					// new StringElement ("iPhone Settings Sample", DemoElementApi),
					// new StringElement ("Dynamically load data", DemoDynamic),
					// new StringElement ("Add/Remove demo", DemoAddRemove),
					// new StringElement ("Assorted cells", DemoDate),
					// new StyledStringElement ("Styled Elements", DemoStyled) { BackgroundUri = new Uri ("file://" + p) },
					// new StringElement ("Load More Sample", DemoLoadMore),
					// new StringElement ("Row Editing Support", DemoEditing),
					// new StringElement ("Advanced Editing Support", DemoAdvancedEditing),
					// new StringElement ("Owner Drawn Element", DemoOwnerDrawnElement),
				},
				new Section ("Container features"){
					// new StringElement ("Pull to Refresh", DemoRefresh),
					// new StringElement ("Headers and Footers", DemoHeadersFooters),
					// new StringElement ("Root Style", DemoContainerStyle),
					// new StringElement ("Index sample", DemoIndex),
				}
				//, new Section ("Json") {
				// 	(Element) (sampleJson = JsonElement.FromFile ("sample.json")),
				// 	// Notice what happens when I close the paranthesis at the end, in the next line:
				// 	(Element) new JsonElement ("Load from URL", "file://" + Path.GetFullPath ("sample.json"))
				// },
				// new Section ("Auto-mapped", footer){
				// 	new StringElement ("Reflection API", DemoReflectionApi)
				// }
			};

			return true;
		}
コード例 #7
0
ファイル: DemoIndex.cs プロジェクト: moljac/MonoMobile.Dialog
		public IndexedViewController (RootElement root, bool pushing) : base (root, pushing)
		{
			// Indexed tables require this style.
			Style = UITableViewStyle.Plain;
			EnableSearch = true;
			SearchPlaceholder = "Find item";
			AutoHideSearch = true;
		}
コード例 #8
0
		public void DemoStyled () 
		{
			var imageBackground = new Uri ("file://" + Path.GetFullPath ("background.png"));
			var image = ImageLoader.DefaultRequestImage (imageBackground, null);
			var small = image.Scale (new SizeF (32, 32));
			
			var imageIcon = new StyledStringElement ("Local image icon") {
				Image = small
			};
			var backgroundImage = new StyledStringElement ("Image downloaded") {
				BackgroundUri = new Uri ("http://www.google.com/images/logos/ps_logo2.png")
			};
			var localImage = new StyledStringElement ("Local image"){
				BackgroundUri = imageBackground
			};
			
			var backgroundSolid = new StyledStringElement ("Solid background") {
				BackgroundColor = UIColor.Green
			};
			var colored = new StyledStringElement ("Colored", "Detail in Green") {
				TextColor = UIColor.Yellow,
				BackgroundColor = UIColor.Red,
				DetailColor = UIColor.Green,
			};
			var sse = new StyledStringElement ("DetailDisclosureIndicator") { Accessory = UITableViewCellAccessory.DetailDisclosureButton };
			sse.AccessoryTapped += delegate {
				var alert = new UIAlertView ("Accessory", "Accessory clicked!", null, "Ok");
				alert.Show ();
			};
			var root = new RootElement("Styled Elements") {
				new Section ("Image icon"){
					imageIcon
				},
				new Section ("Background") { 
					backgroundImage, backgroundSolid, localImage
				},
				new Section ("Text Color"){
					colored
				},
				new Section ("Cell Styles"){
					new StyledStringElement ("Default", "Invisible value", UITableViewCellStyle.Default),
					new StyledStringElement ("Value1", "Aligned on each side", UITableViewCellStyle.Value1),
					new StyledStringElement ("Value2", "Like the Addressbook", UITableViewCellStyle.Value2),
					new StyledStringElement ("Subtitle", "Makes it sound more important", UITableViewCellStyle.Subtitle),
					new StyledStringElement ("Subtitle", "Brown subtitle", UITableViewCellStyle.Subtitle) {
						 DetailColor = UIColor.Brown
					}
				},
				new Section ("Accessories"){
					new StyledStringElement ("DisclosureIndicator") { Accessory = UITableViewCellAccessory.DisclosureIndicator },
					new StyledStringElement ("Checkmark") { Accessory = UITableViewCellAccessory.Checkmark },
					sse
				}
			};
			
			var dvc = new DialogViewController (root, true);
			navigation.PushViewController (dvc, true);
		}
		DialogViewController DialogViewControllerWithCustomElementNonGeneric (RootElement re)
		{
			Section s = SectionGenericSampleFactory ();
			re.Add(s);
			DialogViewController dvc;
			dvc = new DialogViewController(UITableViewStyle.Grouped, re, false);
			
			return dvc;
		}
コード例 #10
0
ファイル: Screen.MA.cs プロジェクト: moljac/MonoMobile.Dialog
		public void Navigate(RootElement root_element_next_screen)
		{
			DialogAdapter da = new DialogAdapter(this, root_element_next_screen);
			ListView lv = new ListView(this)
			{
				Adapter = da
			};
			this.SetContentView(lv);

			return;
		}
コード例 #11
0
		//
		// This method is invoked when the application has loaded and is ready to run. In this 
		// method you should instantiate the window, load the UI into it and then make the window
		// visible.
		//
		// You have 17 seconds to return from this method, or iOS will terminate your application.
		//
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			UINavigationController navigation;
			navigation = new UINavigationController ();

			RootElement re = MonoMobile.XSample.UserInterface.UICities();


			//
			// Create our UI and add it to the current toplevel navigation controller
			// this will allow us to have nice navigation animations.
			//
			DialogViewController dv = new DialogViewController (re)
			{
				Autorotate = true
			};

			int n = 0;
			buttonAdd = new UIBarButtonItem (UIBarButtonSystemItem.Add);
			buttonAdd.Clicked += delegate(object sender, EventArgs e) {
			   
				++n;
			   
				City c = new City{Name = "city " + n};
			   
				RootElement cityElement = new RootElement (c.Name){
			  new Section () {
					  new EntryElement (c.Name,
							 "Enter task description", c.Name)
			  },
			  new Section () {
					  new DateElement ("Due Date", DateTime.Now)
			  }
			};
				//re[0].Add (cityElement);	
			};
			dv.NavigationItem.RightBarButtonItem = buttonAdd;

			navigation.PushViewController(dv, true);

			// On iOS5 we use the new window.RootViewController, on older versions, we add the subview
			window = new UIWindow(UIScreen.MainScreen.Bounds);
			window.MakeKeyAndVisible();
			if (UIDevice.CurrentDevice.CheckSystemVersion(5, 0))
				window.RootViewController = navigation;
			else
				window.AddSubview(navigation.View);

			return true;
		}
コード例 #12
0
		public DialogHelper(Context context, ListView dialogView, RootElement root)
		{
			this.Root = root;
			this.Root.Context = context;

			dialogView.Adapter = this.DialogAdapter = new DialogAdapter(context, this.Root);
			dialogView.ItemClick += 
				// mc++				
				new EventHandler<AdapterView.ItemClickEventArgs>(dialogView_ItemClick)
				// new EventHandler<ItemEventArgs>(ListView_ItemClick) // obsolete
				;
			dialogView.ItemLongClick += ListView_ItemLongClick;;
			dialogView.Tag = root;
		}
コード例 #13
0
ファイル: Screen.MT.cs プロジェクト: moljac/MonoMobile.Dialog
		public void Navigate(RootElement root_element_next_screen)
		{
			// TODO: mc++
			// is new DialgoViewController necessary?
			dv = new DialogViewController 
						(
						  root_element_next_screen
						, true
						);
						
			// iOS version??!?!
			this.PushViewController (dv, true);					

			return;
		}
コード例 #14
0
		public void DemoAdvancedEditing () 
		{
			var root = new RootElement ("Todo list") {
				new Section() {
			        new StringElement ("1", "Todo item 1"),
					new StringElement ("2","Todo item 2"),
					new StringElement ("3","Todo item 3"),
					new StringElement ("4","Todo item 4"),
					new StringElement ("5","Todo item 5")
				}
		    };
			var dvc = new AdvancedEditingDialog (root, true);
			AdvancedConfigEdit (dvc);			
			navigation.PushViewController (dvc, true);
		}
コード例 #15
0
		public void DemoAddRemove ()
		{
			rnd = new Random ();
			var section = new Section (null, "Elements are added randomly") {
				new StringElement ("Add elements", AddElements),
				new StringElement ("Add, with no animation", AddNoAnimation),
				new StringElement ("Remove top element", RemoveElements),
				new StringElement ("Add Section", AddSection),
				new StringElement ("Remove Section", RemoveSection)
			};
			region = new Section ();
			
			demoRoot = new RootElement ("Add/Remove Demo") { section, region };
			var dvc = new DialogViewController (demoRoot, true);
			navigation.PushViewController (dvc, true);
		}
コード例 #16
0
			CreateDialogUI
			(
			)
		{
			RootElement re = 
						new RootElement("Recursive Root Element Test") 
									{
									  // MonoDialog.Android by Kevin McMahon 
									  // needs at leas one Section or Element
									  // otherwise Exception will be thrown
									  new Section("Test")
										{
										}
									};
			return re;
		}
コード例 #17
0
		public void DemoOwnerDrawnElement () 
		{
			var root = new RootElement("Owner Drawn") {
				new Section() {
					new SampleOwnerDrawnElement("000 - "+SmallText, DateTime.Now, "David Black"),
					new SampleOwnerDrawnElement("001 - "+MediumText, DateTime.Now - TimeSpan.FromDays(1), "Peter Brian Telescope"),
					new SampleOwnerDrawnElement("002 - "+LargeText, DateTime.Now - TimeSpan.FromDays(3), "John Raw Vegitable"),
					new SampleOwnerDrawnElement("003 - "+SmallText, DateTime.Now - TimeSpan.FromDays(5), "Tarquin Fintimlinbinwhinbimlim Bus Stop F'tang  F'tang Ole  Biscuit-Barrel"),
					new SampleOwnerDrawnElement("004 - "+WellINeverWhatAWhopperString, DateTime.Now - TimeSpan.FromDays(9), "Kevin Phillips Bong"),
					new SampleOwnerDrawnElement("005 - "+LargeText, DateTime.Now - TimeSpan.FromDays(11), "Alan Jones"),
					new SampleOwnerDrawnElement("006 - "+MediumText, DateTime.Now - TimeSpan.FromDays(32), "Mrs Elsie Zzzzzzzzzzzzzzz"),
					new SampleOwnerDrawnElement("007 - "+SmallText, DateTime.Now - TimeSpan.FromDays(45), "Jeanette Walker"),
					new SampleOwnerDrawnElement("008 - "+MediumText, DateTime.Now - TimeSpan.FromDays(99), "Adrian  Blackpool Rock  Stoatgobblerk"),
					new SampleOwnerDrawnElement("009 - "+SmallText, DateTime.Now - TimeSpan.FromDays(123), "Thomas Moo"),
				}
			};
			root.UnevenRows = true;
			var dvc = new DialogViewController (root, true);
			
			navigation.PushViewController (dvc, true);
		}
コード例 #18
0
		public void DemoLoadMore () 
		{
			Section loadMore = new Section();
			
			var s = new StyledStringElement ("Hola") {
				BackgroundUri = new Uri ("http://www.google.com/images/logos/ps_logo2.png")
				//BackgroundColor = UIColor.Red
			};
			loadMore.Add (s);
			loadMore.Add (new StringElement("Element 1"));
			loadMore.Add (new StringElement("Element 2"));
			loadMore.Add (new StringElement("Element 3"));
						
			
			loadMore.Add (new LoadMoreElement("Load More Elements...", "Loading Elements...", lme => {
				// Launch a thread to do some work
				ThreadPool.QueueUserWorkItem (delegate {
					
					// We just wait for 2 seconds.
					System.Threading.Thread.Sleep(2000);
				
					// Now make sure we invoke on the main thread the updates
					navigation.BeginInvokeOnMainThread(delegate {
						lme.Animating = false;
						loadMore.Insert(loadMore.Count - 1, new StringElement("Element " + (loadMore.Count + 1)),
				    		            new StringElement("Element " + (loadMore.Count + 2)),
				            		    new StringElement("Element " + (loadMore.Count + 3)));
					
					});
				});
				
			}, UIFont.BoldSystemFontOfSize(14.0f), UIColor.Blue));
							
			var root = new RootElement("Load More") {
				loadMore
			};
			
			var dvc = new DialogViewController (root, true);
			navigation.PushViewController (dvc, true);
		}
コード例 #19
0
		public static RootElement CreateRootElement()
		{
			RootElement root = new RootElement("Test Root Elem")
				{
				  new Section("Test Header", "Test Footer")
						{
						  new StringElement
										(
										  "Do Something"
										, () => 
											{
												Console.WriteLine("Did Something");						
											}
										)
						// mc++ No ButtonElement in MT.D!!!
						// mc++ TODO: add Obsolete Attribute or ButtonElelement
						// , new ButtonElement("DialogActivity", () => StartNew())
						, new BooleanElement("Push my button", true)
						, new BooleanElement("Push this too", false)
						, new StringElement("Text label", "The Value")
						, new BooleanElement("Push my button", true)
						, new BooleanElement("Push this too", false)
						,
						}
				, new Section("Part II")
						{
							new StringElement("This is the String Element", "The Value"),
							new CheckboxElement("Check this out", true),
							new EntryElement("Username",""){
								Hint = "Enter Login"
							},
							new EntryElement("Password", "") {
								Hint = "Enter Password",
								Password = true,
							},
						}
				};

			return root;
		}
コード例 #20
0
		public DataLoadingDialogViewController()
			: base(UITableViewStyle.Plain, null)
		{

			ElementCustom ecdg1 = new ElementCustom();

			List<ElementCustom> data_ui = new List<ElementCustom>();

			List<SectionalInformation> data_sectional_info;
			data_sectional_info = SectionalInformationDataFactory.SectionalInformation ();

			foreach (SectionalInformation si in data_sectional_info) 
			{

				ElementCustom ecdg2 = new ElementCustom();

				//UITableViewCellCustom clc = ce.PresentationObjectCell as UITableViewCellCustom;
				// clc.UpdateData(si.Name, si.Elapsed.ToString(), si.Delete);


//				ecdg2.UpdateData += delegate(UITableViewCell c)
//				{
//				};

				data_ui.Add(ecdg2);
			}


			Root = new RootElement ("MTD") 
			{
				new Section ("First Section: Custom cell from XIB")
				{
					data_ui.ToArray()
				},
				new Section ("Second Section: Custom cell from XIB")
				{
				}
			};
		}
コード例 #21
0
		public void DemoContainerStyle () 
		{
			var root = new RootElement ("Container Style") {
				new Section ("A") {
					new StringElement ("Another kind of"),
					new StringElement ("TableView, just by setting the"),
					new StringElement ("Style property"),
				},
				new Section ("C"){
					new StringElement ("Chaos"),
					new StringElement ("Corner"),
				},
				new Section ("Style"){
					from a in "Hello there, this is a long text that I would like to split in many different nodes for the sake of all of us".Split (' ')
						select (Element) new StringElement (a)
				}
			};
			var dvc = new DialogViewController (root, true) {
				Style = UITableViewStyle.Plain
			};
			navigation.PushViewController (dvc, true);
		}
		public DialogViewControllerForElementCustomDerived () : base (UITableViewStyle.Plain, null)
		{
			UIView v = this.View;
			// Load Views from XIB
			NSArray views = NSBundle.MainBundle.LoadNib ("UITableViewSourceForListOfSamples", v, null);
			
			// Extract cell drawn/defined in XIB with Interface Builder 
			// it is one and only UIView thus index 0
			UITableViewCellCustom cell = 
					MonoTouch.ObjCRuntime.Runtime.GetNSObject (views.ValueAt (0))
				 	as UITableViewCellCustom;
			
			ElementCustom ecd1 = 
				new ElementCustom("UITableViewControllerForList")
				{
				CellCustom = cell
				};

			ElementCustom  ecd2 = new ElementCustom(cell);
			
			Root = new RootElement("MTD") 
			{
				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")
				{
					new ElementCustom("UITableViewControllerForList")
				, ecd1
				, ecd2
				},
				// WTF??? no error? check comma in the line above
			};
		}
コード例 #23
0
		//-------------------------------------------------------------------------
		/// <summary>
		///     Creates a new DialogViewController from a RootElement and sets the push status
		/// </summary>
		/// <param name="root">
		/// The <see cref="RootElement"/> containing the information to render.
		/// </param>
		/// <param name="pushing">
		/// A <see cref="System.Boolean"/> describing whether this is being pushed 
		/// (NavigationControllers) or not.   If pushing is true, then the back button 
		/// will be shown, allowing the user to go back to the previous controller
		/// </param>
		public DialogViewController(RootElement root, bool pushing)
			: base(UITableViewStyle.Grouped)
		{
			this.pushing = pushing;
			this.root = root;
		}
コード例 #24
0
 public DialogAdapter(Context context, RootElement root)
 {
     this.context  = context;
     this.inflater = LayoutInflater.From(context);
     this.Root     = root;
 }
コード例 #25
0
		public AdvancedEditingDialog (RootElement root, bool pushing) : base (root, pushing)
		{
		}
コード例 #26
0
		RootElement CreateEditableRoot (RootElement root, bool editable)
		{
		    var rootElement = new RootElement("Todo list") {
				new Section()
			};
			
			foreach (var element in root[0].Elements) {
				if(element is StringElement) {
					rootElement[0].Add(CreateEditableElement (element.Caption, (element as StringElement).Value, editable));
				} else {
					rootElement[0].Add(CreateEditableElement (element.Caption, (element as EntryElement).Value, editable));
				}
			}
			
		    return rootElement;
		}
コード例 #27
0
ファイル: Main.cs プロジェクト: moljac/MonoMobile.Dialog
		// This method is invoked when the application has loaded its UI and its ready to run
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			JsonElement sampleJson;
			var Last = new DateTime (2010, 10, 7);
			Console.WriteLine (Last);
			
			var p = Path.GetFullPath ("background.png");
			
			var menu = new RootElement ("Demos"){
				new Section ("Element API"){
					new StringElement ("Element API HolisticWare", DemoElementApiHolisticWare),
					new StringElement ("iPhone Settings Sample", DemoElementApi),
					new StringElement ("Dynamically load data", DemoDynamic),
					new StringElement ("Add/Remove demo", DemoAddRemove),
					new StringElement ("Assorted cells", DemoDate),
					new StyledStringElement ("Styled Elements", DemoStyled) { BackgroundUri = new Uri ("file://" + p) },
					new StringElement ("Load More Sample", DemoLoadMore),
					new StringElement ("Row Editing Support", DemoEditing),
					new StringElement ("Advanced Editing Support", DemoAdvancedEditing),
					new StringElement ("Owner Drawn Element", DemoOwnerDrawnElement),
				},
				new Section ("Container features"){
					new StringElement ("Pull to Refresh", DemoRefresh),
					new StringElement ("Headers and Footers", DemoHeadersFooters),
					new StringElement ("Root Style", DemoContainerStyle),
					new StringElement ("Index sample", DemoIndex),
				},
				new Section ("Json") {
					(Element) (sampleJson = JsonElement.FromFile ("sample.json")),
					// Notice what happens when I close the paranthesis at the end, in the next line:
					(Element) new JsonElement ("Load from URL", "file://" + Path.GetFullPath ("sample.json"))
				},
				new Section ("Auto-mapped", footer){
					new StringElement ("Reflection API", DemoReflectionApi)
				},
			};
			
			//
			// Lookup elements by ID:
			//
			var jsonSection = sampleJson ["section-1"] as Section;
			Console.WriteLine ("The section has {0} elements", jsonSection.Count);
			var booleanElement = sampleJson ["first-boolean"] as BooleanElement;
			Console.WriteLine ("The state of the first-boolean value is {0}", booleanElement.Value);
			
			//
			// Create our UI and add it to the current toplevel navigation controller
			// this will allow us to have nice navigation animations.
			//
			var dv = new DialogViewController (menu) {
				Autorotate = true
			};
			navigation = new UINavigationController ();
			navigation.PushViewController (dv, true);				
			
			// On iOS5 we use the new window.RootViewController, on older versions, we add the subview
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			window.MakeKeyAndVisible ();
			if (UIDevice.CurrentDevice.CheckSystemVersion (5, 0))
				window.RootViewController = navigation;	
			else
				window.AddSubview (navigation.View);
			
			return true;
		}
コード例 #28
0
		//-------------------------------------------------------------------------
		public DialogViewController(UITableViewStyle style, RootElement root)
			: base(style)
		{
			Style = style;
			this.root = root;
		}
コード例 #29
0
		//-------------------------------------------------------------------------
		public DialogViewController(UITableViewStyle style, RootElement root, bool pushing)
			: base(style)
		{
			Style = style;
			this.pushing = pushing;
			this.root = root;
		}
コード例 #30
0
		//-------------------------------------------------------------------------
		public DialogViewController(RootElement root)
			: base(UITableViewStyle.Grouped)
		{
			this.root = root;
		}
コード例 #31
0
			public Source (DialogViewController container)
			{
				this.Container = container;
				Root = container.root;
			}