Beispiel #1
0
        private void SetBindings()
        {
            SetupTimePicker(edtRequestedArrivalTimeAndDate, UIDatePickerMode.DateAndTime, "{0: MM/dd/yyyy hh:mm tt}", futureDatesOnly: true);

            this.SetBinding(
                () => edtRequestedArrivalTimeAndDate.Text,
                () => Facade.Instance.CurrentRide.RequestedArrivalTimeAndDate,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("ValueChanged");

            #region PickUp elements

            this.SetBinding(
                () => Facade.Instance.CurrentRide.PickUpLocation,
                () => edtAirportPickUpLocation.Text,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("PickUpLocationChanges");

            #endregion

            #region Dropoff elements

            this.SetBinding(
                () => Facade.Instance.CurrentRide.DropOffLocation,
                () => editAirportDropOffLocation.Text,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("DropOffLocationChanges");

            #endregion

            edtAirportPickUpLocation.EditingDidBegin += (object sender, EventArgs e) => {
                UIStoryboard         sb  = UIStoryboard.FromName("MainStoryboard", null);
                PickUpViewController pvc = (PickUpViewController)sb.InstantiateViewController("PickUpViewController");

                pvc.IsPickUpLocation = true;

                edtAirportPickUpLocation.ResignFirstResponder();
                NavigationController.PushViewController(pvc, true);
            };

            btnScheduleARide3.SetCommand("TouchUpInside", Facade.Instance.CurrentRide.GoToThePaymentInformation);
        }
Beispiel #2
0
        private void SetBindings()
        {
            this.SetBinding(
                () => Facade.Instance.CurrentRide.PickUpLocation,
                () => txtSearchLocation.Text,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("PickUpLocationChanges");

            this.SetBinding(
                () => Facade.Instance.CurrentRide.CreditCard,
                () => txtMapCard.Text,
                BindingMode.TwoWay)
            .UpdateTargetTrigger("ValueChanged");

            txtMapPromo.Text = Facade.Instance.CurrentRide.PromoCode;

            this.SetBinding(
                () => txtMapPromo.Text,
                () => Facade.Instance.CurrentRide.PromoCode,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("EditingChanged");

            btnMapAddCreditCard.TouchUpInside += (object sender, EventArgs e) => {
                UIStoryboard sb = UIStoryboard.FromName("MainStoryboard", null);
                AddCreditCardViewController pvc = (AddCreditCardViewController)sb.InstantiateViewController("AddCreditCardViewController");
                pvc.fromWhere = "map";
                NavigationController.PushViewController(pvc, true);
            };

            btnReadyPickup.TouchUpInside += ReadyForPickup;

            txtSearchLocation.EditingDidBegin += (object sender, EventArgs e) => {
                UIStoryboard         sb  = UIStoryboard.FromName("MainStoryboard", null);
                PickUpViewController pvc = (PickUpViewController)sb.InstantiateViewController("PickUpViewController");
                pvc.IsPickUpLocation = true;
                txtSearchLocation.ResignFirstResponder();
                NavigationController.PushViewController(pvc, true);
            };

            btnScheduleARide.SetCommand("TouchUpInside", Facade.Instance.CurrentRide.GoToTheRideInformation);
        }
        private void SetBindings()
        {
            #region             //BEGIN Set up Airlines
            var AirlineResponseItemList = new List <GetAirlineResponseItem> ();

            Task runSync = Task.Factory.StartNew(async() => {
                AirlineResponseItemList = await GetAirline();
            }).Unwrap();
            runSync.Wait();

            var KvpAirlines = new List <KeyValuePair <object, string> > ();
            foreach (var item in AirlineResponseItemList)
            {
                KvpAirlines.Add(new KeyValuePair <object, string> (item.id, item.Airline));
            }

            SetupAirlines(edtDropOffAirlines, KvpAirlines, 2);

            #endregion

            SetupTimePicker(edtRequestedArrivalTimeAndDate, UIDatePickerMode.DateAndTime, "{0: MM/dd/yyyy hh:mm tt}", futureDatesOnly: true);
            SetupTimePicker(edtDropOffFlightTime, UIDatePickerMode.Time, "{0: hh:mm tt}");

            SetupFlightType(edtDropOffFlightType, false);

            this.SetBinding(
                () => edtRequestedArrivalTimeAndDate.Text,
                () => Facade.Instance.CurrentRide.RequestedArrivalTimeAndDate,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("ValueChanged");

            #region PickUp elements

            this.SetBinding(
                () => Facade.Instance.CurrentRide.PickUpLocation,
                () => edtAirportPickUpLocation.Text,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("PickUpLocationChanges");

            #endregion

            #region Dropoff elements

            this.SetBinding(
                () => Facade.Instance.CurrentRide.DropOffLocation,
                () => editAirportDropOffLocation.Text,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("DropOffLocationChanges");

            this.SetBinding(
                () => edtDropOffFlight.Text,
                () => Facade.Instance.CurrentRide.DropOffFlightNumber,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("EditingChanged");

            this.SetBinding(
                () => edtDropOffFlightTime.Text,
                () => Facade.Instance.CurrentRide.DropOffFlightTime,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("ValueChanged");

            #endregion

            edtAirportPickUpLocation.EditingDidBegin += (object sender, EventArgs e) => {
                UIStoryboard         sb  = UIStoryboard.FromName("MainStoryboard", null);
                PickUpViewController pvc = (PickUpViewController)sb.InstantiateViewController("PickUpViewController");

                pvc.IsPickUpLocation = true;

                edtAirportPickUpLocation.ResignFirstResponder();
                NavigationController.PushViewController(pvc, true);
            };

            editAirportDropOffLocation.EditingDidBegin += (object sender, EventArgs e) => {
                UIStoryboard         sb  = UIStoryboard.FromName("MainStoryboard", null);
                PickUpViewController pvc = (PickUpViewController)sb.InstantiateViewController("PickUpViewController");

                pvc.IsPickUpLocation = false;

                editAirportDropOffLocation.ResignFirstResponder();
                NavigationController.PushViewController(pvc, true);
            };

            btnScheduleARide3.SetCommand("TouchUpInside", Facade.Instance.CurrentRide.GoToThePaymentInformation);
        }
Beispiel #4
0
        private void SetBindings()
        {
            btnShared.TouchUpInside += (object sender, EventArgs e) => {
                SetRideType(sender);
            };
            btnPrivate.TouchUpInside += (object sender, EventArgs e) => {
                SetRideType(sender);
            };
            btnBlack.TouchUpInside += (object sender, EventArgs e) => {
                SetRideType(sender);
            };
            btnSUV.TouchUpInside += (object sender, EventArgs e) => {
                SetRideType(sender);
            };
            btnLimo.TouchUpInside += (object sender, EventArgs e) => {
                SetRideType(sender);
            };
            btnBus.TouchUpInside += (object sender, EventArgs e) => {
                SetRideType(sender);
            };
            btnWheel.TouchUpInside += (object sender, EventArgs e) => {
                SetRideType(sender);
            };

            this.SetBinding(
                () => Facade.Instance.CurrentRide.ReservationType,
                () => switchPandH.On,
                BindingMode.TwoWay)
            .UpdateTargetTrigger("ValueChanged");

            SetupPassengers(edtNumberOfPassengers);
            edtNumberOfPassengers.EditingDidEnd += (object sender, EventArgs e) => {
                GetFares();
            };

            this.SetBinding(
                () => Facade.Instance.CurrentRide.NumberOfPassangers,
                () => edtNumberOfPassengers.Text,
                BindingMode.TwoWay)
            .UpdateTargetTrigger("ValueChanged");

            SetupPassengers(edtNumberOfHours);
            edtNumberOfHours.EditingDidEnd += (object sender, EventArgs e) => {
                GetFares();
            };

            this.SetBinding(
                () => Facade.Instance.CurrentRide.NumberOfHours,
                () => edtNumberOfHours.Text,
                BindingMode.TwoWay)
            .UpdateTargetTrigger("ValueChanged");

            #region PickUp elements

            this.SetBinding(
                () => Facade.Instance.CurrentRide.PickUpLocation,
                () => edtPickUpLocation.Text,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("PickUpLocationChanges");

            #endregion

            #region Dropoff elements

            this.SetBinding(
                () => Facade.Instance.CurrentRide.DropOffLocation,
                () => editDropOffLocation.Text,
                BindingMode.TwoWay)
            .UpdateSourceTrigger("DropOffLocationChanges");

            #endregion

            edtPickUpLocation.EditingDidBegin += (object sender, EventArgs e) => {
                UIStoryboard         sb  = UIStoryboard.FromName("MainStoryboard", null);
                PickUpViewController pvc = (PickUpViewController)sb.InstantiateViewController("PickUpViewController");
                pvc.IsPickUpLocation = true;
                edtPickUpLocation.ResignFirstResponder();
                NavigationController.PushViewController(pvc, true);
            };

            editDropOffLocation.EditingDidBegin += (object sender, EventArgs e) => {
                UIStoryboard         sb  = UIStoryboard.FromName("MainStoryboard", null);
                PickUpViewController pvc = (PickUpViewController)sb.InstantiateViewController("PickUpViewController");
                pvc.IsPickUpLocation = false;
                editDropOffLocation.ResignFirstResponder();
                NavigationController.PushViewController(pvc, true);
            };

            btnScheduleARide2.SetCommand("TouchUpInside", Facade.Instance.CurrentRide.GoToTheFlightInformation);
        }