I'm not a massive fan of static classes - but they do have their uses.  I do
something like this:

Declare public property inside your ViewController, or pass it via the
constructor

eg.
*
// via ctor*
public partial class FirstViewController : UIViewController
{
   private Person _person;

   public FirstViewController (IntPtr handle) : base (handle)
   {
   }

   public FirstViewController (Person person)
   {
      _person = person;
   }

*
// via public property*
public partial class FirstViewController : UIViewController
{
   public Person CurrentPerson { get; set; }

   public FirstViewController (IntPtr handle) : base (handle)
   {
   }

Then inside current view controller somewhere:
*
// via ctor*
...{
var fvc = new FirstViewController (currentPerson); 
}

*
// via public property*
...{
var fvc = new FirstViewController (); 
fvc.CurrentPerson= currentPerson;
}


--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/passing-data-between-view-controllers-tp4531089p4531769.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to