Pass value from one TabBar controller to another Controller and set value.
I have 5 UIViewcontroller which is added to UITabBarController.
controller1 = new Controller1();
controller2 = new Controller2();
controller3 = new Controller3();
controller4 = new Controller4();
controller5 = new Controller5();
controller1.TabBarItem = new UITabBarItem ("first", UIImage.FromFile("/Images/first.png"), 0);
controller5.TabBarItem = new UITabBarItem ("second", UIImage.FromFile("/Images/four.png"), 1);
controller5.TabBarItem = new UITabBarItem ("third", UIImage.FromFile("/Images/four.png"), 2);
controller5.TabBarItem = new UITabBarItem ("four", UIImage.FromFile("/Images/four.png"), 3);
controller5.TabBarItem = new UITabBarItem ("five", UIImage.FromFile("/Images/four.png"), 4);
var tabs = new UIViewController[] {
controller1, controller2, controller3, controller4, controller5
};
ViewControllers = tabs;
controller1 have Label
UILabel lbl_Label1;
string setValue = "Welcome";
lbl_Label1.Text = setValue;
from controller3 change controller1 Label value
create Object from Controller1 and set Label text.
Controller1 controller1 = new Controller1();
controller1.lbl_Label1.Text = "Bye";
this.TabBarController.SelectedIndex = 0;
Which is not working. Its shows same Welcome
message for the label of controller1.