I am trying to pass some data between my first and second ViewController
.
I already instantiated the second view controller like this:
RegistrationViewController registration = new RegistrationViewController();
I set the value of the textfield to the variable email from the registration class like this:
registration.email = txtEmail.Text;
this.NavigationController.PushViewController(registration, true);
Then in the second ViewController
I use it like this:
public string email { get; set; }
txtEmail.Text = email ;
Sadly, I don't have a value in the email variable. How can I achieve successfully passing the data to the new ViewController
.
Code for changing the controller:
registration.email = txtEmail.Text;
string password = txtPassword.Text;
RegistrationViewController controller = this.Storyboard.InstantiateViewController("RegistrationViewController") as RegistrationViewController;
this.NavigationController.PushViewController(registration, true);
this.NavigationController.PushViewController(controller, true);