Beispiel #1
0
		public void DemoDynamic ()
		{
			account = new AccountInfo ();
			
			context = new BindingContext (this, account, "Settings");

			if (dynamic != null)
				dynamic.Dispose ();
			
			dynamic = new DialogViewController (context.Root, true);
			navigation.PushViewController (dynamic, true);				
		}
		public void DemoReflectionApi ()
		{	
			if (settings == null){
				var image = UIImage.FromFile ("monodevelop-32.png");
				
				settings = new Settings () {
					AccountEnabled = true,
					Login = "******",
					TimeSamples = new TimeSettings () {
						Appointment = DateTime.Now,
						Birthday = new DateTime (1980, 6, 24),
						Alarm = new DateTime (2000, 1, 1, 7, 30, 0, 0)
					},
					FavoriteType = TypeCode.Int32,
					Top = image,
					Middle = image,
					Bottom = image,
					ListOfString = new List<string> () { "One", "Two", "Three" }
				};
			}
			var bc = new BindingContext (null, settings, "Settings");
			
			var dv = new DialogViewController (bc.Root, true);
			
#warning This removed...
            /*
			// When the view goes out of screen, we fetch the data.
			dv.ViewDisappearing += delegate {
				// This reflects the data back to the object instance
				bc.Fetch ();
				
				// Manly way of dumping the data.
				Console.WriteLine ("Current status:");
				Console.WriteLine (
				    "AccountEnabled:  {0}\n" +
				    "Login:           {1}\n" +
				    "Password:        {2}\n" +
					"Name:      	  {3}\n" +
				    "Appointment:     {4}\n" +
				    "Birthday:        {5}\n" +
				    "Alarm:           {6}\n" +
				    "Favorite Type:   {7}\n" + 
				    "IEnumerable idx: {8}", 
				    settings.AccountEnabled, settings.Login, settings.Password, settings.Name,
				    settings.TimeSamples.Appointment, settings.TimeSamples.Birthday, 
				    settings.TimeSamples.Alarm, settings.FavoriteType,
				    settings.selected);
			};
             */
			navigation.PushViewController (dv, true);	
		}