Forum Xamarin.iOS

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Best way to send data from view2 to view1 with navigation Controller

JoseCarlosToledoMuozJoseCarlosToledoMuoz ESMember ✭✭
edited December 2012 in Xamarin.iOS

Hi, i have a navigation controller with 2 views (view1, view2).

//Example:
public class view1
{
public override void ViewDidLoad()
{
this.NavigationController.PushViewController(new View2(), true);
}

//Back from view2 to view1
public override void ViewDidAppear(bool animated)
{
   //I need call to "idcode" propertie of view2 from view1.
   //I would like have a view2 object as sender to call "sender.idcode"
}

}

public class view2
{
public idcode
{
get..
set..
}

}

How can i send data from view2 to view1 ? Best way?

thanks

Posts

  • I solved this problem :

    • Create a event / delegate OnFinish(sender) en view2 and when i create view2 in view1 , handle a new delegate OnFinishClick(sender). Sender is a object that it contain "view2" to access to yours properties. Its the best practice?

    regards

Sign In or Register to comment.