public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // ios7 layout
            if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
            {
                EdgesForExtendedLayout = UIRectEdge.None;
            }

            MvxFluentBindingDescriptionSet <LoginViewController, LoginViewModel> set =
                this.CreateBindingSet <LoginViewController, LoginViewModel>();

            set.Bind(textField_Email).To(vm => vm.Email);
            set.Bind(textField_Password).To(vm => vm.Password);
            set.Bind(btn_Login).To(x => x.LoginCommand);
            set.Apply();

            var gestureRecognizer = new UITapGestureRecognizer(() =>
            {
                textField_Email.ResignFirstResponder();
                textField_Password.ResignFirstResponder();
            });

            View.AddGestureRecognizer(gestureRecognizer);
        }
예제 #2
0
        protected virtual void BindPrice(UILabel price, MvxFluentBindingDescriptionSet <CatalogGridCell, ICatalogItemVM> set)
        {
            if (price == null)
            {
                return;
            }

            MvxFluentBindingDescription <UILabel, ICatalogItemVM> priceBinding;

            if (Config.UnitNameEnabled)
            {
                priceBinding = set.Bind(price).ByCombining(new PriceFromUnitCombiner(), new [] { "Price", "UnitName", "MaxPrice" });
            }
            else
            {
                priceBinding = set.Bind(price).ByCombining(new PriceFromFormatCombiner(), new [] { "Price", "MaxPrice" });
            }

            if (Config.PriceType != PriceType.FromTo)
            {
                set.Bind(price)
                .For("Visibility")
                .ByCombining(new PriceVisibilityValueCombiner(), new[] { "Price", "MaxPrice" })
                .WithConversion("VisibilityHidden");
            }
        }
예제 #3
0
        public override void ViewDidLoad()
        {
            if (!_constructed)
            {
                return;
            }
            base.ViewDidLoad();

            NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Add);
            NavigationItem.SetHidesBackButton(true, false);

            UIBarButtonItem LogoutButton = new UIBarButtonItem
            {
                Title = "Logout"
            };

            NavigationItem.LeftBarButtonItem = LogoutButton;

            MvxFluentBindingDescriptionSet <JobTabView, JobTabViewModel> set = new MvxFluentBindingDescriptionSet <JobTabView, JobTabViewModel>(this);

            set.Bind(NavigationItem.RightBarButtonItem).To(vm => vm.NavigateToAddJobCommand);
            set.Bind(NavigationItem.LeftBarButtonItem).To(vm => vm.NavigateToLogoutCommand);
            set.Apply();

            CreateTabs();
        }
예제 #4
0
 protected virtual void BindMarkButton(UIButton markButton, MvxFluentBindingDescriptionSet <ModalShortInfoCell, IShortInfoProductsPciVm> set)
 {
     set.Bind(markButton).To(vm => vm.MarkCommand);
     set.Bind(markButton)
     .For(mb => mb.Selected)
     .To(vm => vm.Marked);
 }
예제 #5
0
        protected virtual void BindToField(UITextField toField, MvxFluentBindingDescriptionSet <PDDateMinMaxCell, IDateMinMaxPciVm> set)
        {
            if (ThemeConfig.ProductDetails.DetailsCell.MinMax.DateInputMode == Models.DateInputMode.Manual)
            {
                set.Bind(toField).For("FiltersDateBinding").To(vm => vm.Max);
            }
            else
            {
                set.Bind(toField).To(vm => vm.Max).WithConversion("StringFormat", new StringFormatParameter {
                    StringFormat = StringExtentionsMethods.StringDate
                });
            }

            toField.ShouldEndEditing = (textField) =>
            {
                (DataContext as IDateMinMaxPciVm).MaxValueChangedCommand.Execute(null);
                return(true);
            };

            if (ThemeConfig.ProductDetails.DetailsCell.MinMax.DateInputMode == Models.DateInputMode.Picker)
            {
                var model = (DataContext as IDateMinMaxPciVm);
                BindDatePicker(_toDatePicker, model.Min, model.Max, model.Max);
            }
        }
        void SetComponents(MvxFluentBindingDescriptionSet<SimpleExampleView, SimpleExampleViewModel> Set, AutoLayoutContentView ComponentsBorder)
        {
            var button1 = ComponentsBorder.AddButton ("Button1", "Scroll Example", UIColor.Green, UIColor.White, 12);
            ComponentsBorder.AddActivityIndicator ("ActivityIndicator", UIColor.Blue);
            ComponentsBorder.AddPageControl ("PageControl", UIColor.Blue);
            ComponentsBorder.AddProgressView ("ProgressView", UIColor.Blue);
            ComponentsBorder.AddSlider ("Slider", UIColor.Blue);
            ComponentsBorder.AddSwitch ("Switch", UIColor.Blue);
            ComponentsBorder.AddSegmentedControl ("SegmentedControl", UIColor.Blue);
            // We can add in other UIViews that don't have their own bespoke Add methods.
            var button2 = (UIButton)ComponentsBorder.AddView ("Button2", UIButton.FromType (UIButtonType.RoundedRect));
            button2.SetTitle ("List Example", UIControlState.Normal);
            ComponentsBorder.AddConstraint ("V:|-[Button1(20)]-[ActivityIndicator(60)]-[PageControl(50)]-[ProgressView(50)]-[Slider]-[Switch]-[SegmentedControl]-|");
            ComponentsBorder.AddConstraint ("V:|-[Button2(20)]-(>=8)-|");
            ComponentsBorder.AddConstraint ("H:|-[Button1(<=100)]-[Button2(<=100)]-(>=8)-|");

            // TODO: these controls still need some beautification and MVX binding.

            ComponentsBorder.AddConstraint ("H:|-[ActivityIndicator(60)]-(>=8)-|");
            ComponentsBorder.AddConstraint ("H:|-[PageControl(50)]-(>=8)-|");
            ComponentsBorder.AddConstraint ("H:|-[ProgressView(50)]-(>=8)-|");
            ComponentsBorder.AddConstraint ("H:|-[Slider(100)]-(>=8)-|");
            ComponentsBorder.AddConstraint ("H:|-[Switch]-(>=8)-|");
            ComponentsBorder.AddConstraint ("H:|-[SegmentedControl]-(>=8)-|");

            Set.Bind (button1).For ("Tap").To (vm => vm.GotoScrollView).WithConversion ("CommandParameter", "scrollView");
            Set.Bind (button2).For ("Tap").To (vm => vm.GotoListView).WithConversion ("CommandParameter", "listView");
        }
        public override void ViewDidLoad()
        {
            try
            {
                base.ViewDidLoad();
                _skinViewSource = new SkinViewSource(SkinCollection);


                SkinCollection.Source = _skinViewSource;
                SkinCollection.ReloadData();
            }
            catch (Exception ex)
            {
                Console.Write(ex);
            }
            MvxFluentBindingDescriptionSet <DetailView3, DetailView3Model> set = this.CreateBindingSet <DetailView3, DetailView3Model>();

            set.Bind(imgBackground).For(iv => iv.Image).To(a => a.SkinImage).WithConversion <StringToImageConverter>();

            set.Bind(_skinViewSource).To(vm => vm.ChampionDetailSkins);
            set.Bind(_skinViewSource)
            .For(src => src.SelectionChangedCommand)
            .To(vm => vm.SkinSelectedCommand);

            set.Apply();
        }
        void SetComponents(MvxFluentBindingDescriptionSet <SimpleExampleView, SimpleExampleViewModel> Set, AutoLayoutContentView ComponentsBorder)
        {
            var button1 = ComponentsBorder.AddButton("Button1", "Scroll Example", UIColor.Green, UIColor.White, 12);

            ComponentsBorder.AddActivityIndicator("ActivityIndicator", UIColor.Blue);
            ComponentsBorder.AddPageControl("PageControl", UIColor.Blue);
            ComponentsBorder.AddProgressView("ProgressView", UIColor.Blue);
            ComponentsBorder.AddSlider("Slider", UIColor.Blue);
            ComponentsBorder.AddSwitch("Switch", UIColor.Blue);
            ComponentsBorder.AddSegmentedControl("SegmentedControl", UIColor.Blue);
            // We can add in other UIViews that don't have their own bespoke Add methods.
            var button2 = (UIButton)ComponentsBorder.AddView("Button2", UIButton.FromType(UIButtonType.RoundedRect));

            button2.SetTitle("List Example", UIControlState.Normal);
            ComponentsBorder.AddConstraint("V:|-[Button1(20)]-[ActivityIndicator(60)]-[PageControl(50)]-[ProgressView(50)]-[Slider]-[Switch]-[SegmentedControl]-|");
            ComponentsBorder.AddConstraint("V:|-[Button2(20)]-(>=8)-|");
            ComponentsBorder.AddConstraint("H:|-[Button1(<=100)]-[Button2(<=100)]-(>=8)-|");

            // TODO: these controls still need some beautification and MVX binding.

            ComponentsBorder.AddConstraint("H:|-[ActivityIndicator(60)]-(>=8)-|");
            ComponentsBorder.AddConstraint("H:|-[PageControl(50)]-(>=8)-|");
            ComponentsBorder.AddConstraint("H:|-[ProgressView(50)]-(>=8)-|");
            ComponentsBorder.AddConstraint("H:|-[Slider(100)]-(>=8)-|");
            ComponentsBorder.AddConstraint("H:|-[Switch]-(>=8)-|");
            ComponentsBorder.AddConstraint("H:|-[SegmentedControl]-(>=8)-|");


            Set.Bind(button1).For("Tap").To(vm => vm.GotoScrollView).WithConversion("CommandParameter", "scrollView");
            Set.Bind(button2).For("Tap").To(vm => vm.GotoListView).WithConversion("CommandParameter", "listView");
        }
        protected virtual void BindUserImage(UIImageView imageView, MvxFluentBindingDescriptionSet <ProfileMenuHeaderView, ProfileMenuHeaderViewModel> set)
        {
            var imageLoader = new MvxImageViewLoader(() => imageView);

            set.Bind(imageLoader).To(vm => vm.UserPhotoUrl);
            set.Bind(imageView).For("Visibility").To(vm => vm.UserSignedIn).WithConversion("Visibility");
        }
예제 #10
0
 protected virtual void BindTextField(ARTextField textField, MvxFluentBindingDescriptionSet <SignUpItemBaseViewCell, ISignUpItemBaseViewModel> set)
 {
     set.Bind(textField).To(vm => vm.Value);
     set.Bind(textField)
     .For(p => p.Error)
     .To(vm => vm.Invalid);
 }
예제 #11
0
        protected virtual void BindDeliveryTimeLabel(UIView deliveryPickerView, UILabel deliveryTimeLabel, MvxFluentBindingDescriptionSet <FullOrderViewController, IFullOrderViewModel> set)
        {
            set.Bind(deliveryTimeLabel).To(vm => vm.DeliveryViewModel.SelectedDeliveryTimeValue).OneWay();

            _deliveryTimeView.ActionOnTap(() => ShowDeliveryTimePicker(deliveryPickerView));
            set.Bind(_deliveryTimeView).For("Visibility").To(vm => vm.DeliveryViewModel.IsShowDeliveryTimePicker).WithConversion("Visibility");
        }
        protected void BindCodeField(UITextField textField, UITextField accessoryTextField, MvxFluentBindingDescriptionSet <PromoCodeView, IPromoCodeViewModel> set)
        {
            set.Bind(textField).To(vm => vm.Code);
            set.Bind(textField).For("EditingDidEnd").To(vm => vm.ApplyCommand);

            set.Bind(accessoryTextField).To(vm => vm.Code);
            set.Bind(accessoryTextField).For("EditingDidEnd").To(vm => vm.ApplyCommand);
        }
 protected virtual void BindName(UILabel valueName, MvxFluentBindingDescriptionSet <VerticalTextCell, CollectionItemVM> set)
 {
     set.Bind(valueName).To(vm => vm.ValueName);
     set
     .Bind(valueName)
     .For(v => v.Highlighted)
     .To(vm => vm.Selected);
 }
예제 #14
0
 protected virtual void BindStepperView(UIView stepperView, UITextField quantityTextField, UILabel unitName, UIButton decrementBtn, UIButton incrementBtn, MvxFluentBindingDescriptionSet <BasketProductCardView, IBasketProductCardViewModel> set)
 {
     set.Bind(stepperView).For("Visibility").To(vm => vm.UnitStepVisible).WithConversion("Visibility");
     set.Bind(quantityTextField).To(vm => vm.QuantityString);
     set.Bind(unitName).To(vm => vm.UnitName);
     set.Bind(decrementBtn).To(vm => vm.DecrementCommand);
     set.Bind(incrementBtn).To(vm => vm.IncrementCommand);
 }
예제 #15
0
        private void SetBinding()
        {
            bindingSet = this.CreateBindingSet <MedicationDosageView, MedicationDosageViewModel>();

            //sposob na bezposrednie sluchanie observable. W momencie, gdy CanExecute sie zmieni wykona sie kod z Subscribe
            this.ViewModel.Delete.CanExecute.Subscribe(canExecute => deleteBtn.Visibility = canExecute ? ViewStates.Visible : ViewStates.Gone);

            bindingSet.Bind(this.SupportActionBar)
            .To(x => x.MedicationName)
            .For(v => v.Title)
            .WithConversion(new InlineValueConverter <string, string>(medicationName =>
            {
                if (string.IsNullOrEmpty(medicationName))
                {
                    return(this.ViewModel.Id.HasValue ? "" : AppResources.MedicationDosageViewModel_Title);
                }
                return(medicationName);
            }));

            bindingSet.Bind(nameText)
            .To(x => x.MedicationName);

            bindingSet.Bind(picture)
            .To(x => x.Bytes)
            .For("Bitmap")
            .WithConversion(new MvxInMemoryImageValueConverter());

            bindingSet.Bind(picture)
            .To(x => x.Bytes)
            .For(v => v.Visibility)
            .WithConversion(new InlineValueConverter <byte[], ViewStates>((byte[] arg) => arg == null ? ViewStates.Gone : ViewStates.Visible));

            bindingSet.Bind(takePicutre)
            .For(nameof(View.Click))
            .To(vm => vm.TakePhotoCommand);

            bindingSet.Bind(dosageText)
            .To(vm => vm.MedicationDosage);
            bindingSet.Bind(everyday)
            .For(nameof(View.Click))
            .To(vm => vm.SelectAllDays);
            bindingSet.Bind(everyday)
            .For(v => v.Checked)
            .To(vm => vm.Everyday);
            bindingSet.Bind(custom)
            .For(v => v.Checked)
            .To(vm => vm.Cusom);



            bindingSet.Bind(hoursList)
            .For(x => x.ItemsSource)
            .To(vm => vm.DosageHours);
            bindingSet.Apply();


            //Bitmap.Compress(Bitmap.CompressFormat.Jpeg, 100, stream);
        }
예제 #16
0
        void Bind()
        {
            _bindingSet = this.CreateBindingSet <VectorViewController, VectorViewModel>();

            _bindingSet.Bind(_sizeSlider).To(vm => vm.Size);
            _bindingSet.Bind(_vectorImageView).For(iOSConstants.SIZE_TARGET_BINDING_KEY).To(vm => vm.Size);

            _bindingSet.Apply();
        }
예제 #17
0
        public MvxFluentBindingDescriptionSet <ViewController, ViewModel> BindLoader <ViewController, ViewModel>(MvxFluentBindingDescriptionSet <ViewController, ViewModel> bindingSet)
            where ViewController : class, IMvxBindingContextOwner
            where ViewModel : BaseViewModel
        {
            bindingSet.Bind(Loader).For(b => b.Hidden).To(vm => vm.IsBusy).WithConversion(new LoaderVisibilityConverter()).Apply();
            bindingSet.Bind(this).For(c => c.Title).To(vm => vm.Title).Apply();

            return(bindingSet);
        }
예제 #18
0
 private void SetBinding(MvxFluentBindingDescriptionSet <LoadDataView, LoadDataViewModel> set)
 {
     set.Bind(this).For(pt => pt.Title).To(vm => vm.Title);
     set.Bind(_processTitle).For(pt => pt.Text).To(vm => vm.BusyText);
     set.Bind(_activityView).For(av => av.Hidden).To(vm => vm.IsBusy).WithConversion(new BusyViewModelToActivitryValueConverter());
     set.Bind(_okButton).For(ob => ob.Hidden).To(vm => vm.IsBusy);
     set.Bind(_okButton).For(ob => ob).To(vm => vm.ShowCategoriesCommand);
     set.Apply();
 }
        protected virtual void BindTable(UITableView tableView, MvxFluentBindingDescriptionSet <LanguagesViewController, ILanguagesViewModel> set)
        {
            var dataSource = SetupTableViewDataSource(tableView);

            tableView.Source = dataSource;

            set.Bind(dataSource).To(vm => vm.Items);
            set.Bind(dataSource).For(d => d.SelectionChangedCommand).To(vm => vm.SelectionChangedCommand);
        }
        protected virtual void BindPickerView(UIPickerView pickerView, MvxFluentBindingDescriptionSet <SignUpItemPickerViewCell, SignUpItemPickerViewModel> set)
        {
            var bindablePickerViewModel = new PickerViewModel(pickerView);

            set.Bind(bindablePickerViewModel).For(p => p.SelectedItem).To(vm => vm.Value);
            set.Bind(bindablePickerViewModel).For(p => p.ItemsSource).To(vm => vm.Items);

            pickerView.Model = bindablePickerViewModel;
        }
예제 #21
0
        protected virtual void BindCollectionView(UICollectionView collectionView, MvxFluentBindingDescriptionSet <PDHorizontalProductsCollectionCell, IHorizontalProductsCollectionPciVm> set)
        {
            var dataSource = SetupCollectionDataSource(collectionView);

            collectionView.Source = dataSource;

            set.Bind(dataSource).To(vm => vm.Items);
            set.Bind(dataSource).For(ds => ds.SelectionChangedCommand).To(vm => vm.SelectionChangedCommand);
        }
예제 #22
0
        private void CreateBindings()
        {
            MvxFluentBindingDescriptionSet <MainView, MainViewModel> bindingSet = this.CreateBindingSet <MainView, MainViewModel>();

            bindingSet.Bind(Name).For(v => v.Text).To(vm => vm.NameText);
            bindingSet.Bind(Header).For(v => v.Text).To(vm => vm.HeaderText);
            //bindingSet.Bind(Description).For(v => v.Text).To(vm => vm.WantedPerson.DescriptionText);
            bindingSet.Bind(Image).For(v => v.Image).To(vm => vm.ImageURL).WithConversion(new StringToImageConverter());
            bindingSet.Apply();
        }
예제 #23
0
        public override void LayoutSubviews()
        {
            base.LayoutSubviews();

            MvxFluentBindingDescriptionSet <ParkingTableCell, Parking> set = new MvxFluentBindingDescriptionSet <ParkingTableCell, Parking>(this);

            set.Bind(lblParking).To(res => res.description);
            set.Bind(lblPlaatsen).To(res => res.AvailablePlacesString);
            set.Apply();
        }
예제 #24
0
        protected virtual void BindBottomCollection(UICollectionView bottomCollection, MvxFluentBindingDescriptionSet <SSCategoriesViewController, ISSCategoriesViewModel> set)
        {
            var bottomDataSource = new MvxCollectionViewSource(bottomCollection, BannerCell.Key);

            set.Bind(bottomDataSource).To(vm => vm.BottomBanners);
            set.Bind(bottomDataSource).For(ds => ds.SelectionChangedCommand).To(vm => vm.BannerSelectionChangedCommand);

            bottomCollection.Source = bottomDataSource;
            bottomCollection.ReloadData();
        }
        public override void LayoutSubviews()
        {
            base.LayoutSubviews();

            MvxFluentBindingDescriptionSet <SkinViewCell, ChampionDetailSkins> set = new MvxFluentBindingDescriptionSet <SkinViewCell, ChampionDetailSkins>(this);

            set.Bind(NameLabel).To(a => a.Name);
            set.Bind(ImageView).For(iv => iv.Image).To(a => a.backgroundImage).WithConversion <StringToImageConverter>();
            set.Apply();
        }
예제 #26
0
        protected virtual void BindValuePicker(UIPickerView valuePicker, MvxFluentBindingDescriptionSet <PDPickerCell, IPickerPciVm> set)
        {
            var pickerModel = new PickerViewModel(valuePicker);

            set.Bind(pickerModel).For(m => m.ItemsSource).To(vm => vm.Items);
            set.Bind(pickerModel).For(m => m.SelectedItem).To(vm => vm.SelectedItem);
            set.Bind(pickerModel).For(m => m.SelectedChangedCommand).To(vm => vm.SelectionChangedCommand);

            valuePicker.Model = pickerModel;
        }
예제 #27
0
        protected override void BindView()
        {
            MvxFluentBindingDescriptionSet <MenuView, MenuViewModel>
            bindingSet = this.CreateBindingSet <MenuView, MenuViewModel>();

            bindingSet.Bind(_menuHome.Tap()).For(v => v.Command).To(vm => vm.ShowHomeCommand);
            bindingSet.Bind(_menuSettings.Tap()).For(v => v.Command).To(vm => vm.ShowSettingsCommand);

            bindingSet.Apply();
        }
        protected virtual void BindNextButton(UIButton nextButton, MvxFluentBindingDescriptionSet <DeliveryOnPointVC, IDeliveryOnPointVM> set)
        {
            if (OrderViewType == OrderViewType.Partial)
            {
                set.Bind(nextButton).For("Title").To(vm => vm.Amount).WithConversion("StringFormat", "Заказать{0: за # ### ##0.## ₽;;}");
            }

            set.Bind(nextButton).To(vm => vm.NextCommand);
            set.Bind(nextButton).For(s => s.Enabled).To(vm => vm.CanGoNext);
        }
        protected virtual void BindTableView(UITableView tableView, MvxFluentBindingDescriptionSet <DeliveryOnPointVC, IDeliveryOnPointVM> set)
        {
            var dataSource = SetupTableViewDataSource(tableView);

            set.Bind(dataSource).For(s => s.ItemsSource).To(vm => vm.DeliveryPointsItems);
            set.Bind(dataSource).For(s => s.SelectionChangedCommand).To(vm => vm.DeliveryPointChangedCommand);

            tableView.Source = dataSource;
            tableView.ReloadData();
        }
예제 #30
0
        protected virtual void BindCollectionView(UICollectionView collectionView, MvxFluentBindingDescriptionSet <SSCategoriesViewController, ISSCategoriesViewModel> set)
        {
            var dataSource = SetupCollectionDataSource(collectionView);

            set.Bind(dataSource).To(vm => vm.Items);
            set.Bind(dataSource).For(ds => ds.SelectionChangedCommand).To(vm => vm.SelectionChangedCommand);

            collectionView.Source = dataSource;
            collectionView.ReloadData();
        }
예제 #31
0
        protected virtual void BindTableView(UITableView tableView, MvxFluentBindingDescriptionSet <FullOrderViewController, IFullOrderViewModel> set)
        {
            var dataSource = SetupTableViewDataSource(tableView);

            set.Bind(dataSource).For(s => s.ItemsSource).To(vm => vm.Items);
            set.Bind(dataSource).For(s => s.SelectionChangedCommand).To(vm => vm.SelectionChangedCommand);

            tableView.Source = dataSource;
            tableView.ReloadData();
        }
 void SetUpHourBindings(MvxFluentBindingDescriptionSet<NewAppointmentView, NewAppointmentViewModel> set)
 {
     set.Bind(hourTextField).To(vm => vm.SelectedHour).OneWay();
     _hourPicker = new UIPickerView {
         ShowSelectionIndicator = true
     };
     var hourPickerViewModel = new MvxPickerViewModel(_hourPicker);
     _hourPicker.Model = hourPickerViewModel;
     set.Bind(hourPickerViewModel).For(p => p.ItemsSource).To(vm => vm.PossibleHours).OneWay();
     set.Bind(hourPickerViewModel).For(p => p.SelectedItem).To(vm => vm.SelectedHour).OneWayToSource();
 }
 void SetUpDoctorBindings(MvxFluentBindingDescriptionSet<NewAppointmentView, NewAppointmentViewModel> set)
 {
     set.Bind(doctorTextField).To(vm => vm.SelectedDoctor.Name).OneWay();
     _doctorPicker = new UIPickerView {
         ShowSelectionIndicator = true
     };
     var doctorPickerViewModel = new MvxPickerViewModel(_doctorPicker);
     _doctorPicker.Model = doctorPickerViewModel;
     set.Bind(doctorPickerViewModel).For(p => p.ItemsSource).To(vm => vm.Doctors).OneWay();
     set.Bind(doctorPickerViewModel).For(p => p.SelectedItem).To(vm => vm.SelectedDoctor).OneWayToSource();
 }
        static void SetPremisesTabs(MvxFluentBindingDescriptionSet<TicketView, TicketViewModel> Set, AutoLayoutContentView PremisesBorder)
        {
            var PremisesTabBox = PremisesBorder.AddContainer ("PremisesTabBox", UIColor.White);
            var ConnectionPillarTabBox = PremisesBorder.AddContainer ("ConnectionPillarTabBox", UIColor.LightGray);
            var ExchangeTabBox = PremisesBorder.AddContainer ("ExchangeTabBox", UIColor.LightGray);
            var PremisesLabel = PremisesTabBox.AddLabelCenteredXY ("PremisesTab", "PREMISES", UIColor.Black, 15);
            ConnectionPillarTabBox.AddLabelCenteredXY ("ConnectionPillarTab", "P74", UIColor.Blue, 15);
            ExchangeTabBox.AddLabelCenteredXY ("ExchangeTab", "PARR", UIColor.Blue, 15);

            Set.Bind (PremisesTabBox).For ("Tap").To (vm => vm.TestCommand).WithConversion ("CommandParameter", "alex");
            // https://github.com/MvvmCross/MvvmCross/wiki/Value-Converters
            Set.Bind (PremisesTabBox).For (field => field.BackgroundColor).To (vm => vm.PremisesTabBackgroundColor).WithConversion ("RGBA");
            Set.Bind (PremisesLabel).For (field => field.TextColor).To (vm => vm.PremisesTabTextColor).WithConversion ("RGBA");
            SetPremises (Set, PremisesBorder);
        }
 static void SetPremises(MvxFluentBindingDescriptionSet<TicketView, TicketViewModel> Set, AutoLayoutContentView PremisesBorder)
 {
     var address = PremisesBorder.AddLabel ("PremisesAddress", "UNIT 103, 402 DRAYTON-WELLCAMP RD PARRAMATTA", UIColor.Black, 15);
     Set.Bind (address).To (vm => vm.Hello);
     SetPremisesDirections (Set, PremisesBorder);
     PremisesBorder.AddConstraint ("V:|[PremisesTabBox(55)]-20-[PremisesAddress(60)]-18-|");
     PremisesBorder.AddConstraint ("V:|[ExchangeTabBox(55)]-20-[PremisesAddress(60)]-18-|");
     PremisesBorder.AddConstraint ("V:|[ConnectionPillarTabBox(55)]-20-[PremisesAddress(60)]-18-|");
     PremisesBorder.AddConstraint ("V:|[PremisesTabBox(55)]-28-[PremisesDirectionsBox]-(>=8)-|");
     PremisesBorder.AddConstraint ("H:|[PremisesTabBox]-2-[ConnectionPillarTabBox(==PremisesTabBox)]-2-[ExchangeTabBox(==PremisesTabBox)]|");
     PremisesBorder.AddConstraint ("H:|-19-[PremisesAddress(<=200)]-(>=6)-[PremisesDirectionsBox(66)]-10-|");
 }
 void SetCustomer(MvxFluentBindingDescriptionSet<TicketView, TicketViewModel> Set, AutoLayoutContentView Customer)
 {
     Customer.AddLabel ("CustomerLabel", "CUSTOMER", UIColor.LightGray/*TelstraGreyL6*/, TowLabelTextSize);
     var name = Customer.AddLabel ("CustomerName", "Alex Eadie", UIColor.Black, TowDataTextSize);
     var telstra = Customer.AddImage ("Customer_telstra_img", "ic_telstra_logo.png");
     Customer.AddConstraint ("V:|-18-[CustomerLabel]-7-[CustomerName]|");
     Customer.AddConstraint ("V:|-20-[Customer_telstra_img(28)]-(>=8)-|");
     Customer.AddConstraint ("H:|-19-[CustomerLabel]-(>=8)-|");
     Customer.AddConstraint ("H:|-19-[CustomerName]-(>=8)-|");
     Customer.AddConstraint ("H:|-(>=8)-[Customer_telstra_img(28)]-27-|");
     Set.Bind (name).To (vm => vm.Hello);
     Set.Bind (telstra).For ("Visibility").To (vm => vm.Telstra).WithConversion ("Visibility");
 }
 void SetContact(MvxFluentBindingDescriptionSet<TicketView, TicketViewModel> Set, AutoLayoutContentView SiteContact)
 {
     SiteContact.AddLabel ("SiteContactLabel", "SITE CONTACT", UIColor.LightGray/*TelstraGreyL6*/, TowLabelTextSize);
     var name = SiteContact.AddLabel ("SiteContactName", "Natasha Eadie", UIColor.Black, TowDataTextSize);
     var phone = SiteContact.AddLabel ("SiteContactPhone", "0412 123 456", UIColor.Black, TowDataTextSize);
     SiteContact.AddImage ("SitePhoneImage", "ic_phone.png");
     SiteContact.AddConstraint ("V:|[SiteContactLabel]-3-[SiteContactName]-3-[SiteContactPhone]-18-|");
     SiteContact.AddConstraint ("V:|-20-[SitePhoneImage(23)]-(>=8)-|");
     SiteContact.AddConstraint ("H:|-19-[SiteContactLabel]-(>=8)-|");
     SiteContact.AddConstraint ("H:|-19-[SiteContactName]-(>=10)-[SitePhoneImage(23)]-27-|");
     SiteContact.AddConstraint ("H:|-19-[SiteContactPhone]-(>=8)-|");
     Set.Bind (name).To (vm => vm.Hello);
     Set.Bind (phone).To (vm => vm.Hello);
 }
		void SetUpAverageBindings(MvxFluentBindingDescriptionSet<NewAppointmentView, NewAppointmentViewModel> set)
		{
			set.Bind (avgLabel)
				.For (l => l.Text).To (vm => vm.WaitingTimeAvg)
				.WithConversion (new IntToMinutesStringConverter ())
				.OneWay ();
		}
예제 #39
0
		void SetUpTipBindings (MvxFluentBindingDescriptionSet<HomeView, HomeViewModel> set)
		{
			set.Bind (dailyTipTitleLabel).To (vm => vm.Tip.Title);
			set.Bind (dailyTipLabel).To (vm => vm.Tip.Content);
		}
예제 #40
0
		void SetUpPillsBindings (MvxFluentBindingDescriptionSet<HomeView, HomeViewModel> set)
		{
			set.Bind (firstMedicineCountDownImage).To (vm => vm.FirstMedicineCountDown).WithConversion (new CountDownValueToImageSourceConverter ());
			set.Bind (firstMedicineCountDownImage).For (c => c.Hidden).To (vm => vm.FirstMedicine).WithConversion (new MvxVisibilityValueConverter ());
			set.Bind (firstMedicineCountDownImage).For (c => c.Alpha).To (vm => vm.FirstMedicineSelected).WithConversion (new BoolToAlphaNativeConverter ());
			set.Bind (firstMedicineButton).For ("Title").To (vm => vm.FirstMedicine.Medicine).WithConversion (new MedicineToNameWithDosisConverter ());
			set.Bind (firstMedicineButton).To (vm => vm.ChangeToFirstMedicineCommand);
			set.Bind (firstMedicineButton).For (c => c.Hidden).To (vm => vm.FirstMedicine).WithConversion (new MvxVisibilityValueConverter ());
			set.Bind (firstMedicineButton).For (c => c.Alpha).To (vm => vm.FirstMedicineSelected).WithConversion (new BoolToAlphaNativeConverter ());
			set.Bind (secondMedicineCountDownImage).To (vm => vm.SecondMedicineCountDown).WithConversion (new CountDownValueToImageSourceConverter ());
			set.Bind (secondMedicineCountDownImage).For (c => c.Hidden).To (vm => vm.SecondMedicine).WithConversion (new MvxVisibilityValueConverter ());
			set.Bind (secondMedicineCountDownImage).For (c => c.Alpha).To (vm => vm.FirstMedicineSelected).WithConversion (new BoolToAlphaNativeConverter (), true);
			set.Bind (secondMedicineButton).For ("Title").To (vm => vm.SecondMedicine.Medicine).WithConversion (new MedicineToNameWithDosisConverter ());
			set.Bind (secondMedicineButton).To (vm => vm.ChangeToSecondMedicineCommand);
			set.Bind (secondMedicineButton).For (c => c.Hidden).To (vm => vm.SecondMedicine).WithConversion (new MvxVisibilityValueConverter ());
			set.Bind (secondMedicineButton).For (c => c.Alpha).To (vm => vm.FirstMedicineSelected).WithConversion (new BoolToAlphaNativeConverter (), true);
			set.Bind (currentMedicineLabel).To (vm => vm.CurrentMedicine.Medicine).WithConversion (new MedicineToNameWithDosisConverter ());
			set.Bind (currentMedicineLeftTimeLabel).To (vm => vm.CurrentMedicine.NextDoseTime).WithConversion (new TimeOfDayToStringConverter ());
			set.Bind (countDownImageView).To (vm => vm.CountDown).WithConversion (new CountDownValueToImageSourceConverter ());
			set.Bind (currentMedicineBreakfastCountLabel).To (vm => vm.CurrentMedicine.BreakfastDoses);
			set.Bind (currentMedicineLunchCountLabel).To (vm => vm.CurrentMedicine.LunchDoses);
			set.Bind (currentMedicineDinnerCountLabel).To (vm => vm.CurrentMedicine.DinnerDoses);
		}
예제 #41
0
		void SetUpAppointmentsBindings (MvxFluentBindingDescriptionSet<HomeView, HomeViewModel> set)
		{
			set.Bind (meetingDetailsView).For (view => view.Frame).To (vm => vm.FirstAppointment).WithConversion (new NullToFrameHeightZeroConverter (), meetingDetailsView.Frame);
			set.Bind (doctorPictureImageView).To (vm => vm.FirstAppointment.Doctor.Picture).WithConversion ("InMemoryImage");
			set.Bind (doctorNameLabel).To (vm => vm.FirstAppointment.Doctor.Name);
			set.Bind (doctorJobTitleLabel).To (vm => vm.FirstAppointment.Speciality).WithConversion (new SpecialityIdToStringConverter ());
            set.Bind (urgentMeetingLabel).For (label => label.Hidden).To (vm => vm.FirstAppointment.IsUrgent).WithConversion (new NotConverter ()).WithFallback(true);
			set.Bind (meetingDateLabel).To (vm => vm.FirstAppointment.DateTime).WithConversion (new DateTimeToMonthDayYearConverter ());
			set.Bind (meetingHourLabel).To (vm => vm.FirstAppointment.DateTime).WithConversion (new DateTimeToHourMinutesConverter ());
			set.Bind (meetingHourIndicatorLabel).To (vm => vm.FirstAppointment.DateTime).WithConversion (new DateTimeToHourIndicatorConverter ());
			set.Bind (meetingRoomLabel).To (vm => vm.FirstAppointment.RoomNumber);
			set.Bind (secondMeetingQuickView).For (view => view.Frame).To (vm => vm.SecondAppointment).WithConversion (new NullToFrameHeightZeroConverter (), meetingDetailsView.Frame);
			set.Bind (doctor2PictureImageView).To (vm => vm.SecondAppointment.Doctor.Picture).WithConversion ("InMemoryImage");
			set.Bind (doctor2NameLabel).To (vm => vm.SecondAppointment.Doctor.Name);
			set.Bind (doctor2JobTitleLabel).To (vm => vm.SecondAppointment.Speciality).WithConversion (new SpecialityIdToStringConverter ());
			set.Bind (meeting2DateLabel).To (vm => vm.SecondAppointment.DateTime).WithConversion (new DateTimeToMonthDayYearConverter ());
			set.Bind (meeting2HourLabel).To (vm => vm.SecondAppointment.DateTime).WithConversion (new DateTimeToHourMinutesConverter ());
		}
 void SetUpSpecialityBindings(MvxFluentBindingDescriptionSet<NewAppointmentView, NewAppointmentViewModel> set)
 {
     set.Bind(specialityTextField).To(vm => vm.SelectedSpeciality).OneWay();
     _specialityPicker = new UIPickerView {
         ShowSelectionIndicator = true
     };
     var specialityPickerViewModel = new MvxPickerViewModel(_specialityPicker);
     _specialityPicker.Model = specialityPickerViewModel;
     set.Bind(specialityPickerViewModel).For(p => p.ItemsSource).To(vm => vm.AvailableSpecialities).OneTime();
     set.Bind(specialityPickerViewModel).For(p => p.SelectedItem).To(vm => vm.SelectedSpeciality).OneWayToSource();
 }