public override void ViewDidLoad() { base.ViewDidLoad(); SetTitle("Add a spot"); // Perform any additional setup after loading the view, typically from a nib. var set = this.CreateBindingSet <AddSpotSizeView, AddSpotSizeViewModel>(); set.Bind(btnDone).To(vm => vm.DoneCommand); var source = new VehicleTypeTableSource(tableTypes, this); set.Bind(source).For(v => v.ItemsSource).To(vm => vm.VehicleTypes); #region Language Binding set.Bind(btnDone).For("Title").To(vm => vm.TextSource).WithConversion("Language", "DoneText"); #endregion set.Apply(); tableTypes.Source = source; tableTypes.ReloadData(); }
public override void ViewDidLoad() { base.ViewDidLoad(); ViewModel.PropertyChanged += (sender, e) => { if (e.PropertyName.Equals("VehicleTypes")) { tableCarType.ReloadData(); } }; SetTitle(ViewModel.IsEditMode ? ViewModel.TextSource.GetText("EditPageTitle") : ViewModel.TextSource.GetText("PageTitle")); // Perform any additional setup after loading the view, typically from a nib. var set = this.CreateBindingSet <AddVehicleView, AddVehicleViewModel>(); set.Bind(tfPlateNumber).To(vm => vm.PlateNumber); set.Bind(btnAdd).To(vm => vm.AddNewVehicleCommand); set.Bind(btnAdd).For(v => v.Hidden).To(vm => vm.IsEditMode); var source = new VehicleTypeTableSource(tableCarType, this); set.Bind(source).For(s => s.ItemsSource).To(vm => vm.VehicleTypes); #region Language Binding set.Bind(btnAdd).For("Title").To(vm => vm.ButtonTitle).WithConversion("AddEditButtonTitle", ViewModel.IsEditMode ? "Edit" : "Add"); set.Bind(lbPlateNumber).To(vm => vm.TextSource).WithConversion("Language", "PlateNumberText"); #endregion set.Apply(); tableCarType.Source = source; tableCarType.ReloadData(); #region UI Settings this.AutomaticallyAdjustsScrollViewInsets = false; #endregion }