top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How to make View-to-View Data Binding in Xamarin.Forms with Xaml?

+1 vote
57 views
How to make View-to-View Data Binding in Xamarin.Forms with Xaml?
posted Nov 8, 2017 by Jdk

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

You can do it effectively the same way as the XAML example simply by setting your view's BindingContext to the other view.

var stepper = new Stepper();

var label = new Label {
BindingContext = stepper
};
label.SetBinding (Label.TextProperty, new Binding ("Value", stringFormat: "{0:F0}"));

Alternatively, you can set the Binding.Source:

var stepper = new Stepper();

var label = new Label();
label.SetBinding (Label.TextProperty, new Binding ("Value", stringFormat: "{0:F0}", source: stepper));

answer Jul 18 by Rushabh Verma R.
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...