public WithBinding() { InitializeComponent(); _guide = new Models.Guide(); _guide.GuideName = "Jennie"; _guide.HomeCity = "Miami"; _guide.NumberOfGuidedTours = 67; this.BindingContext = _guide; }
public ChangeNotificationPage() { InitializeComponent(); var guide = new Models.Guide(); guide.GuideName = "Jennie"; guide.HomeCity = "Miami"; guide.NumberOfToursLed = 67; this.BindingContext = guide; }
public WithoutBinding() { InitializeComponent(); #region Property set by direct assignment Label2.Text = "From a C# String"; var guide = new Models.Guide(); guide.GuideName = "Jennie"; guide.HomeCity = "Miami"; guide.NumberOfGuidedTours = 67; Label2.Text = guide.GuideName; #endregion }
public WithoutBinding() { InitializeComponent(); // Text property set by direct assignment Label2.Text = "From a C# String"; var guide = new Models.Guide(); guide.GuideName = "Jennie"; guide.HomeCity = "Miami"; guide.NumberOfToursLed = 67; // Text property set from a Guide property // this is _not_ data binding! Label2.Text = guide.GuideName; }
public WithBinding() { InitializeComponent(); _guide = new Models.Guide(); _guide.GuideName = "Jennie"; _guide.HomeCity = "Miami"; _guide.NumberOfToursLed = 67; this.BindingContext = _guide; // note: you can set a BindingContext at a lower scope // for example in child element. var anotherGuide = new Models.Guide(); anotherGuide.GuideName = "Andrew"; anotherGuide.HomeCity = "Toronto"; anotherGuide.NumberOfToursLed = 24; ChildStackLayout.BindingContext = anotherGuide; }