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"); }
static void SetPremisesDirections(MvxFluentBindingDescriptionSet<TicketView, TicketViewModel> Set, AutoLayoutContentView PremisesBorder) { var PremisesDirectionsBox = PremisesBorder.AddContainer ("PremisesDirectionsBox", UIColor.White); PremisesDirectionsBox.AddLabelCenteredX ("PremisesDirections", "Directions", UIColor.Blue, 12); PremisesDirectionsBox.AddImageCenteredX ("PremisesDirectionsImage", "ic_directions.png"); PremisesDirectionsBox.AddConstraint ("V:|[PremisesDirectionsImage(36)]-3-[PremisesDirections]|"); PremisesDirectionsBox.AddConstraint ("H:|-(>=1)-[PremisesDirectionsImage(36)]-(>=1)-|"); PremisesDirectionsBox.AddConstraint ("H:|-(>=1)-[PremisesDirections]-(>=1)-|"); }
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(); }
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(); }
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(); }
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 SetProfile(MvxFluentBindingDescriptionSet<SimpleExampleView, SimpleExampleViewModel> Set, AutoLayoutContentView ProfileBorder) { var Details = ProfileBorder.AddContainer ("Details", UIColor.White); var Photo = ProfileBorder.AddContainer ("Photo", UIColor.White); ProfileBorder.AddConstraint ("V:|-[Details]-|"); ProfileBorder.AddConstraint ("V:|-[Photo]-(>=8)-|"); ProfileBorder.AddConstraint ("H:|-[Details]-(>=8)-[Photo]-|"); Photo.AddImageCenteredX ("Picture", "Alex.jpg"); Photo.AddConstraint ("H:|[Picture(48)]|"); Photo.AddConstraint ("V:|[Picture(64)]|"); Details.AddLabelLeft ("Name", "Alex Eadie", UIColor.Black, 12); Details.AddLabelLeft ("Phone", "0456 234 154", UIColor.Blue, 12); Details.AddLabelLeft ("Email", "*****@*****.**", UIColor.Blue, 12); Details.AddConstraint ("V:|[Name]-[Phone]-[Email]-(>=8)-|"); }
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 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); }
protected virtual void BindValueName(UILabel valueName, MvxFluentBindingDescriptionSet <PickerCell, IPickerFiVm> set) { set.Bind(valueName).To(vm => vm.ValueName); set .Bind(valueName) .For(v => v.TextColor) .To(vm => vm.Selected) .WithConversion( "TrueFalse", new TrueFalseParameter { True = ThemeConfig.Filters.FiltersCell.Picker.Value.HighlightedTextColor.ToUIColor(), False = ThemeConfig.Filters.FiltersCell.Picker.Value.TextColor.ToUIColor() } ); }
public override void ViewDidLoad() { _myJobViewSource = new MyJobViewSource(this.TableView); base.ViewDidLoad(); this.TableView.Source = _myJobViewSource; this.TableView.ReloadData(); MvxFluentBindingDescriptionSet <MyJobView, MyJobViewModel> set = new MvxFluentBindingDescriptionSet <MyJobView, MyJobViewModel>(this); set.Bind(_myJobViewSource).To(vm => vm.Jobs); set.Bind(_myJobViewSource).For(src => src.SelectionChangedCommand).To(vm => vm.NavigateToDetailCommand); set.Bind(_myJobViewSource).For(s => s.RemoveRowCommand).To(vm => vm.RemoveItemCommand); set.Apply(); }
public override void ViewDidLoad() { var g = new UITapGestureRecognizer(() => View.EndEditing(true)); g.CancelsTouchesInView = false; View.AddGestureRecognizer(g); base.ViewDidLoad(); //SEARCH BAR BEGINNING var searchController = new UISearchController(searchResultsController: null); searchController.SearchBar.SizeToFit(); searchController.SearchBar.SearchBarStyle = UISearchBarStyle.Prominent; TabBarController.NavigationItem.HidesSearchBarWhenScrolling = false; TabBarController.NavigationItem.SearchController = searchController; NavigationController.NavigationBar.PrefersLargeTitles = true; this.Title = "Search"; _searchBar = searchController.SearchBar; _searchBar.SearchButtonClicked += SearchBar_SearchButtonClicked; _searchBar.TextChanged += SearchBarOnTextChanged; _searchBar.CancelButtonClicked += SearchBarOnCancelButtonClicked; //SEARCHBAR ENDING _recipeViewSource = new RecipeViewSource(this.TableView, IndexTableCell.Identifier, 125); this.TableView.Source = _recipeViewSource; this.TableView.ReloadData(); try { MvxFluentBindingDescriptionSet <TabIndexView, TabIndexViewModel> set = new MvxFluentBindingDescriptionSet <TabIndexView, TabIndexViewModel>(this); set.Bind(_recipeViewSource).To(vm => vm.FilteredRecepies); set.Bind(_recipeViewSource) .For(src => src.SelectionChangedCommand) .To(vm => vm.NavigateToDetailCommand); set.Apply(); } catch (Exception ex) { throw ex; } }
public override void LayoutSubviews() { base.LayoutSubviews(); //Binding met de labels en iconen van de cellen MvxFluentBindingDescriptionSet <WeekTableCell, Weather.Daily.DailyDatas> set = new MvxFluentBindingDescriptionSet <WeekTableCell, Weather.Daily.DailyDatas>(this); set.Bind(lblDag).To(vm => vm.Day); set.Bind(lblSummary).To(vm => vm.Summary); set.Bind(lblTemperatuur).To(vm => vm.TempHigh); //Icon binden EN MET CONVERTER! set.Bind(imgIcon) .For(img => img.Image) .To(vm => vm.Icon) .WithConversion <StringToImageConverter>(); //Bindings applyen set.Apply(); //============BACKGROUND COLOR INSTELLEN================ //Uur opvragen voor if else statement int currentTime = DateTime.Now.Hour; //Andere background kleur naar gelange het uur if (currentTime <= 6 || currentTime >= 21) { this.BackgroundColor = UIColor.FromRGB(27, 41, 54); } else if (currentTime <= 9 || currentTime >= 18 && currentTime <= 21) { this.BackgroundColor = UIColor.FromRGB(174, 111, 37); } else if (currentTime <= 18) { this.BackgroundColor = UIColor.FromRGB(49, 89, 94); } else { this.BackgroundColor = UIColor.FromRGB(49, 89, 94); } }
protected virtual void BindMaxPrice(UILabel maxPrice, MvxFluentBindingDescriptionSet <CatalogGridCell, ICatalogItemVM> set) { if (maxPrice == null) { return; } if (!(Config.PriceType == PriceType.To || Config.PriceType == PriceType.FromTo)) { maxPrice.Hidden = true; return; } set.Bind(maxPrice).For(v => v.Text).To(vm => vm.MaxPrice); set.Bind(maxPrice).For("Visibility").To(vm => vm.MaxPrice).WithConversion("Visibility"); }
protected virtual void BindPrice(UILabel price, MvxFluentBindingDescriptionSet <CatalogGridCell, ICatalogItemVM> set) { if (price == null) { return; } set.Bind(price).For(v => v.Text).To(vm => vm.Price); if (Config.PriceType != PriceType.FromTo) { set.Bind(price) .For("Visibility") .ByCombining(new PriceVisibilityCommonValueCombiner(), new[] { "Price", "MaxPrice" }) .WithConversion("VisibilityHidden"); } }
protected virtual void BindTableView(UITableView tableView, MvxFluentBindingDescriptionSet <SSCategoriesViewController, ISSCategoriesViewModel> set) { var dataSource = new SSCategoriesTableViewSource(tableView, SSCategoryCell.Key, SSCategoryCell.Key); set.Bind(dataSource).To(vm => vm.Items); set.Bind(dataSource).For(ds => ds.SelectionChangedCommand).To(vm => vm.SelectionChangedCommand); tableView.Source = dataSource; tableView.ReloadData(); set.Bind(tableView).For(v => v.TableHeaderView).To(vm => vm.TopBanners.Count).WithConversion("SizeVisibility", new SizeVisibilityParameter { View = tableView.TableHeaderView, MinimumHeight = () => 0 }); set.Bind(tableView).For(v => v.TableFooterView).To(vm => vm.BottomBanners.Count).WithConversion("SizeVisibility", new SizeVisibilityParameter { View = tableView.TableFooterView, MinimumHeight = () => 0 }); }
public override void ViewDidLoad() { _weekTableViewSource = new WeekTableViewSource(this.TableView); base.ViewDidLoad(); this.TableView.Source = _weekTableViewSource; this.TableView.ReloadData(); //viewModel met model binden MvxFluentBindingDescriptionSet <TabWeekTableView, TabWeekTableViewModel> set = new MvxFluentBindingDescriptionSet <TabWeekTableView, TabWeekTableViewModel>(this); //Tablesource binden met de list set.Bind(_weekTableViewSource).To(vm => vm.DailyDataList); set.Apply(); }
public override void ViewDidLoad() { base.ViewDidLoad(); MvxFluentBindingDescriptionSet <DetailView, DetailViewModel> set = this.CreateBindingSet <DetailView, DetailViewModel>(); //Kleur Tekst in baar this.NavigationController.NavigationBar.TintColor = UIColor.White; //Titel geven aan pagina set.Bind(this).For(v => v.Title).To(vm => vm.ParkingContent.description); //"Back" instellen ipv "Live Parking" //this.NavigationController.NavigationBar.TopItem.Title = "Back"; set.Bind(lblParkingName).To(vm => vm.ParkingContent.description); set.Bind(lblAddress).To(vm => vm.ParkingContent.address); set.Bind(lblFreePlaces).To(vm => vm.ParkingContent.parkingStatus.availableCapacity); set.Bind(btnNavigate).To(vm => vm.NavigateCommand); set.Bind(lblPlacesTaken).To(vm => vm.ParkingContent.PlacesTaken); set.Bind(lblPlacesTotal).To(vm => vm.ParkingContent.parkingStatus.totalCapacity); //Navigatiebaar vullen set.Bind(pbBaar).For(s => s.Progress).To(vm => vm.ParkingContent.Progress); //Gebied van de map waarop gefocust moet worden set.Bind(mpMap).For(s => s.Region).To(vm => vm.FocusRegion); //Annotatie op de map toevoegen // add an annotation: //set.Bind(mpMap).For(s => s.SelectedAnnotations).To(vm => vm.ParkingContent.MapAnnotation); mpMap.AddAnnotations(ViewModel.ParkingContent.MapAnnotation); #region ENKEL NODIG BIJ DEPLOYEN OP FYSIEKE IPHONE DOOR BUG //Map bij laden focussen op gebied: CLLocationCoordinate2D coords = new CLLocationCoordinate2D(ViewModel.ParkingContent.latitude, ViewModel.ParkingContent.longitude); MKCoordinateSpan span = new MKCoordinateSpan(0.01, 0.01); mpMap.Region = new MKCoordinateRegion(coords, span); #endregion set.Apply(); }
protected virtual void BindOldPrice(UILabel oldPrice, MvxFluentBindingDescriptionSet <CatalogGridCell, ICatalogItemVM> set) { if (oldPrice == null) { return; } if (Config.UnitNameEnabled) { set.Bind(oldPrice).ByCombining(new PriceUnitCombiner(), new[] { "OldPrice", "UnitNameOld" }); } else { set.Bind(oldPrice).To(vm => vm.OldPrice).WithConversion("PriceFormat"); } set.Bind(oldPrice).For("Visibility").To(vm => vm.OldPrice).WithConversion("Visibility"); }
public override void ViewDidLoad() { base.ViewDidLoad(); MvxFluentBindingDescriptionSet <AddLocationView, AddLocationViewModel> set = new MvxFluentBindingDescriptionSet <AddLocationView, AddLocationViewModel>(this); set.Bind(txtCity).To(vm => vm.Location.City); set.Bind(txtCountry).To(vm => vm.Location.Country); set.Bind(txtNumber).To(vm => vm.Location.Number); set.Bind(txtStreet).To(vm => vm.Location.Street); set.Bind(btnNext).To(vm => vm.Next); btnMyLocation.TouchUpInside += (sender, ea) => { GetAddress(); }; set.Apply(); }
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()); }
public override void ViewDidLoad() { try { base.ViewDidLoad(); MvxFluentBindingDescriptionSet <TabReviewView, TabReviewViewModel> set = this.CreateBindingSet <TabReviewView, TabReviewViewModel>(); set.Bind(txtDateOfVisist).To(vm => vm.NewReview.TimeStampOfVisit); set.Bind(txtComment).To(vm => vm.NewReview.Comment); set.Bind(txtScore).To(vm => vm.NewReview.Score); set.Bind(txtUsername).To(vm => vm.NewReview.UserName); set.Bind(btnSave).To(vm => vm.SaveReviewCommand); set.Apply(); } catch (Exception e) { throw e; } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var view = base.OnCreateView(inflater, container, savedInstanceState); _recyclerView = view.FindViewById <MvxRecyclerView>(Resource.Id.recycler_view); _bindingSet = this.CreateBindingSet <PlayerSelectionFragment, PlayerSelectionViewModel>(); _bindingSet.Bind(_recyclerView).For(c => c.ItemClick).To(vm => vm.ItemSelectedCommand); _bindingSet.Bind(_recyclerView).For(c => c.ItemsSource).To(vm => vm.PlayersCollection); _bindingSet.Apply(); //ViewModel.PlayerSelectionChanged += PlayerSelectionChanged; HasOptionsMenu = true; return(view); }
protected override UIView CreateHeaderView(UITableView tableView, ref MvxFluentBindingDescriptionSet <BaseMenuView <BaseMenuViewModel>, BaseMenuViewModel> set) { var headerView = new MenuHeaderView(new CGRect(0f, 0f, (float)UIScreen.MainScreen.Bounds.Width, Math.Min(180, 0.3f * (float)View.Bounds.Height))); headerView.SetHeightContraint(Math.Min(180, 0.3f * (float)View.Bounds.Height), NSLayoutRelation.Equal); ImageViewAvatarTargetBinding.DefaultColor = this.ThemeManager().Colors.AccentColor; set.Bind(headerView).For(v => v.IsAuth).To(vm => vm.IsAuth); set.Bind(headerView.UsernameLabel).To(vm => vm.CurrentUser.Username); set.Bind(headerView.BalanceLabel).To(vm => vm.CurrentUser.BalanceShortInfo).WithConversion(BalanceShortInfoConverter.Key); set.Bind(headerView.AvatarImageView).For(ImageViewAvatarTargetBinding.Key).To(vm => vm.CurrentUser.Username); set.Bind(headerView.AnonymBalanceLabel).To(vm => vm.CurrentUser.BalanceShortInfo).WithConversion(BalanceShortInfoConverter.Key); set.Bind(headerView.AnonymBalanceLabel).For(v => v.Hidden).To(vm => vm.HaveIsVirtualCard).WithConversion(InvertedBooleanConverter.Key); set.Bind(headerView.LanguageContainerView).For(v => v.Hidden).To(vm => vm.IsLocalization).WithConversion(InvertedBooleanConverter.Key); set.Bind(headerView.LanguageImageView).For(v => v.BindTap()).To(vm => vm.ChangeLocalizationCommand); set.Bind(headerView.LanguageLabel.Tap()).For(v => v.Command).To(vm => vm.ChangeLocalizationCommand); set.Bind(headerView.LanguageLabel).To(vm => vm.CurrentCulture); return(headerView); }
protected virtual void BindNextButton(UIButton nextButton, MvxFluentBindingDescriptionSet <FullOrderViewController, IFullOrderViewModel> set) { set.Bind(nextButton) .For("Title") .To(vm => vm.DeliveryViewModel.Amount) .WithConversion( "StringFormat", new StringFormatParameter { StringFormat = (arg) => { var str = string.Format($"{LocalizationService.GetLocalizableString(BasketConstants.RESX_NAME, "Order_OrderBy")} за {{0}}", ((decimal)arg).ToString("# ### ##0.##").Trim()); return(OrderTheme.NextButton.UppercaseTitle ? str.ToUpperInvariant() : str); } }); set.Bind(nextButton).To(vm => vm.NextCommand); set.Bind(nextButton).For(s => s.Enabled).To(vm => vm.CanGoNext); }
public override void ViewDidLoad() { if (!_constructed) { return; } base.ViewDidLoad(); NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Compose); MvxFluentBindingDescriptionSet <WeatherTabsView, WeatherTabsViewModel> set = this.CreateBindingSet <WeatherTabsView, WeatherTabsViewModel>(); //Button navigatie binden set.Bind(NavigationItem.RightBarButtonItem).To(vm => vm.NotificationsCommand); set.Apply(); //tabs aanmaken CreateTabs(); }
protected virtual void BindNextButton(UIButton nextButton, MvxFluentBindingDescriptionSet <BasketViewController, IBasketViewModel> set) { set.Bind(nextButton) .For("Title") .To(vm => vm.Amount) .WithConversion( "StringFormat", new StringFormatParameter { StringFormat = (arg) => { var str = $"{LocalizationService.GetLocalizableString(BasketConstants.RESX_NAME, "Basket_OrderBy")} {((decimal)arg).ToString(AppSettings.CurrencyFormat, AppSettings.SettingsCulture.NumberFormat)}"; return(BasketTheme.NextButton.UppercaseTitle ? str.ToUpperInvariant() : str); } }); set.Bind(nextButton).To(vm => vm.NextCommand); set.Bind(nextButton).For(s => s.Enabled).To(vm => vm.CanGoNext); set.Bind(nextButton).For("Visibility").To(vm => vm.Items.Count).WithConversion("Visibility"); }
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.Bind(_menuTip.Tap()).For(v => v.Command).To(vm => vm.ShowTipCommand); bindingSet.Bind(_menuChinook.Tap()).For(v => v.Command).To(vm => vm.ShowChinookCommand); bindingSet.Bind(_menuLifecycle.Tap()).For(v => v.Command).To(vm => vm.ShowLifecycleCommand); bindingSet.Bind(_menuFFImage.Tap()).For(v => v.Command).To(vm => vm.ShowFFImageCommand); bindingSet.Bind(_menuRestDemo.Tap()).For(v => v.Command).To(vm => vm.ShowRestDemoCommand); bindingSet.Bind(_menuSpinner.Tap()).For(v => v.Command).To(vm => vm.ShowSpinnerCommand); bindingSet.Bind(_menuColor.Tap()).For(v => v.Command).To(vm => vm.ShowColorCommand); bindingSet.Bind(_menuWebView.Tap()).For(v => v.Command).To(vm => vm.ShowWebViewCommand); bindingSet.Bind(_menuWebView2.Tap()).For(v => v.Command).To(vm => vm.ShowOnWeb); bindingSet.Apply(); }
public override void LayoutSubviews() { base.LayoutSubviews(); var searchController = new UISearchController(searchResultsController: null); try { MvxFluentBindingDescriptionSet <IndexTableCell, Recipe> set = new MvxFluentBindingDescriptionSet <IndexTableCell, Recipe>(this); set.Bind(TitleRecipe).To(res => res.name); set.Bind(SubtitleRecipe).To(res => res.description); set.Bind(ThumbnailPicture).For(img => img.Image).To(res => res.thumbnail).WithConversion <StringToImageConverter>(); set.Apply(); } catch (Exception ex) { throw ex; } }
public override void ViewDidLoad() { _tableViewSource = new BestsellersTableViewSource(MyTableView); base.ViewDidLoad(); this.TableView.Source = _tableViewSource; this.TableView.ReloadData(); MvxFluentBindingDescriptionSet <LibraryTableView, LibraryTableViewModel> set = new MvxFluentBindingDescriptionSet <LibraryTableView, LibraryTableViewModel>(this); set.Bind(_tableViewSource).To(vm => vm.MyLibrary); set.Bind(_tableViewSource) .For(src => src.SelectionChangedCommand) .To(vm => vm.ParentViewModel.NavigateToDetailCommand); //set.Bind(_tableViewSource) // .For(s => s.RemoveRowCommand) // .To(vm => vm.RemoveBookCommand); set.Apply(); }
public TasksViewHolder(View itemView, IMvxAndroidBindingContext context) : base(itemView, context) { int screenWidth = Resources.System.DisplayMetrics.WidthPixels; TextView nameTaskHolder = itemView.FindViewById <TextView>(Resource.Id.TaskName); nameTaskHolder.LayoutParameters.Width = screenWidth - Constants.AndroidTaskItemSwipeWidth; TextView descriptionTaskHolder = itemView.FindViewById <TextView>(Resource.Id.TaskShortDescription); this.DelayBind(() => { MvxFluentBindingDescriptionSet <TasksViewHolder, TaskRequestModel> set = this.CreateBindingSet <TasksViewHolder, TaskRequestModel>(); set.Bind(nameTaskHolder).To(x => x.TaskName); set.Bind(descriptionTaskHolder).To(y => y.TaskDescription); set.Apply(); }); }
public override void ViewDidLoad() { base.ViewDidLoad(); _favoriteViewSource = new FavoriteViewSource(this.TableView, FavoriteViewCell.Identifier, 125); this.TableView.Source = _favoriteViewSource; this.TableView.ReloadData(); MvxFluentBindingDescriptionSet <TabFavoriteView, TabFavoriteViewModel> set = new MvxFluentBindingDescriptionSet <TabFavoriteView, TabFavoriteViewModel>(this); set.Bind(_favoriteViewSource).To(vm => vm.Favorites); set.Bind(_favoriteViewSource) .For(src => src.SelectionChangedCommand) .To(vm => vm.NavigateToDetailCommand); set.Bind(_favoriteViewSource).For(s => s.ReorderCommand).To(vm => vm.Reorder); set.Bind(_favoriteViewSource).For(s => s.RemoveRowCommand).To(vm => vm.RemoveFavoriteCommand); set.Apply(); }
public override void ViewDidLoad() { base.ViewDidLoad(); MvxFluentBindingDescriptionSet <TabInfoView, TabInfoViewModel> set = this.CreateBindingSet <TabInfoView, TabInfoViewModel>(); set.Bind(lblName).To(vm => vm.RestaurantContent.Name); set.Bind(lblScore).To(vm => vm.RestaurantContent.Score); set.Bind(lblPriceRange).To(vm => vm.RestaurantContent.PriceRangeString); set.Bind(lblAddress).To(vm => vm.RestaurantContent.Location.Address); set.Bind(lblCuisines).To(vm => vm.RestaurantContent.Cuisines); set.Bind(imgRestaurant) .For(img => img.Image) .To(vm => vm.RestaurantContent.ImageUrl) .WithConversion <StringToImageConverter>(); set.Bind(lblScore).For(lbl => lbl.BackgroundColor).To(vm => vm.RestaurantContent.Score).WithConversion <ScoreToColorConverter>(); set.Apply(); }
public override void ViewDidLoad() { base.ViewDidLoad(); MvxFluentBindingDescriptionSet <BookDetailsView, BookDetailsViewModel> set = this.CreateBindingSet <BookDetailsView, BookDetailsViewModel>(); set.Bind(lblTitle) .To(vm => vm.BookContent.volumeInfo.title); set.Bind(imgBook) .To(vm => vm.BookContent.volumeInfo.imageLinks.thumbnail) .WithConversion <StringToImageConverter>(); set.Bind(lblDescription) .To(vm => vm.BookDescription); set.Bind(lblAuthor) .To(vm => vm.BookContent.volumeInfo.authors[0]); set.Bind(btnAddToLibrary) .For("Title") .To(vm => vm.ButtonLibraryText); set.Bind(btnAddToLibrary) .To(vm => vm.SaveToLibraryCommand); set.Apply(); }
protected virtual void BindIsAvailable(MvxFluentBindingDescriptionSet <HistoryOrderProductCell, IHistoryOrderProductItemVM> set) { var imageOpacity = new TrueFalseParameter() { True = 1f, False = 0.5f }; var textColor = new TrueFalseParameter() { True = ThemeConfig.HistoryOrderItemCell.Title.TextColor.ToUIColor(), False = Theme.ColorPalette.TextGray.ToUIColor() }; set.Bind(OverlayView).To(vm => vm.IsAvailable).For(v => v.Hidden); set.Bind(TotalPriceLabel).To(vm => vm.IsAvailable).For("Visibility").WithConversion("Visibility"); set.Bind(ItemImageView).To(vm => vm.IsAvailable).For(v => v.Alpha) .WithConversion("TrueFalse", imageOpacity); set.Bind(TitleLabel).To(vm => vm.IsAvailable).For(v => v.TextColor) .WithConversion("TrueFalse", textColor); set.Bind(AmountLabel).To(vm => vm.IsAvailable).For(v => v.TextColor) .WithConversion("TrueFalse", textColor); }
public override void ViewDidLoad() { try { base.ViewDidLoad(); MvxFluentBindingDescriptionSet <DetailView, DetailViewModel> set = this.CreateBindingSet <DetailView, DetailViewModel>(); set.Bind(imgBackground).To(vm => vm.ChampionDetail.Image.backgroundImage).WithConversion <StringToImageConverter>(); set.Bind(lblName).To(vm => vm.ChampionDetail.Name); set.Bind(lblTitle).To(vm => vm.ChampionDetail.Title); set.Apply(); } catch (Exception ex) { Console.Write(ex); } }
protected virtual void BindMaxPrice(UILabel maxPrice, MvxFluentBindingDescriptionSet <CatalogGridCell, ICatalogItemVM> set) { if (maxPrice == null) { return; } if (!(Config.PriceType == PriceType.To || Config.PriceType == PriceType.FromTo)) { maxPrice.Hidden = true; return; } MvxFluentBindingDescription <UILabel, ICatalogItemVM> priceBinding; if (Config.UnitNameEnabled) { priceBinding = set.Bind(maxPrice).ByCombining(new PriceUnitCombiner(), new [] { "MaxPrice", "UnitName" }); } else { priceBinding = set.Bind(maxPrice).To(vm => vm.MaxPrice); } priceBinding.WithConversion( "StringFormat", new StringFormatParameter() { StringFormat = (arg) => { if (!Config.UnitNameEnabled) { arg = new PriceFormatConverter().Convert(arg, typeof(Decimal?), null, null); } return($"{LocalizationService.GetLocalizableString(ProductsConstants.RESX_NAME, "Catalog_PriceTo")} {arg}"); } } ); set.Bind(maxPrice).For("Visibility").To(vm => vm.MaxPrice).WithConversion("Visibility"); }
private void SetupNavigationBar() { var _backButton = new UIButton(UIButtonType.Custom); _backButton.Frame = new CGRect(0, 0, 40, 40); _backButton.SetImage(UIImage.FromBundle("backButton"), UIControlState.Normal); NavigationItem.SetLeftBarButtonItems(new UIBarButtonItem[] { new UIBarButtonItem(_backButton) }, false); var _saveButton = new UIButton(UIButtonType.Custom); _saveButton.Frame = new CGRect(0, 0, 40, 40); _saveButton.SetImage(UIImage.FromBundle("saveButton"), UIControlState.Normal); NavigationItem.SetRightBarButtonItems(new UIBarButtonItem[] { new UIBarButtonItem(_saveButton) }, false); MvxFluentBindingDescriptionSet <MapViewController, MapViewModel> set = this.CreateBindingSet <MapViewController, MapViewModel>(); set.Bind(_backButton).To(vm => vm.BackViewCommand); set.Bind(_saveButton).To(vm => vm.SaveMapMarkerCommand); set.Apply(); }
void SetUpTipBindings (MvxFluentBindingDescriptionSet<HomeView, HomeViewModel> set) { set.Bind (dailyTipTitleLabel).To (vm => vm.Tip.Title); set.Bind (dailyTipLabel).To (vm => vm.Tip.Content); }
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 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); }
void SetCustomerAndContact(MvxFluentBindingDescriptionSet<TicketView, TicketViewModel> Set, AutoLayoutContentView ContactBorder) { var Customer = ContactBorder.AddContainer ("Customer", UIColor.White); var SiteContact = ContactBorder.AddContainer ("SiteContact", UIColor.White); ContactBorder.AddConstraint ("V:|-[Customer]-25-[SiteContact]|"); ContactBorder.AddConstraint ("H:|-[Customer]-(>=8)-|"); ContactBorder.AddConstraint ("H:|-[SiteContact]-(>=8)-|"); SetCustomer (Set, Customer); SetContact (Set, SiteContact); }
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 (); }