Esempio n. 1
0
        public WithBinding()
        {
            InitializeComponent();
            _guide                     = new Models.Guide();
            _guide.GuideName           = "Jennie";
            _guide.HomeCity            = "Miami";
            _guide.NumberOfGuidedTours = 67;

            this.BindingContext = _guide;
        }
Esempio n. 2
0
        public ChangeNotificationPage()
        {
            InitializeComponent();
            var guide = new Models.Guide();

            guide.GuideName        = "Jennie";
            guide.HomeCity         = "Miami";
            guide.NumberOfToursLed = 67;

            this.BindingContext = guide;
        }
Esempio n. 3
0
        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
        }
Esempio n. 4
0
        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;
        }
Esempio n. 5
0
        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;
        }