private void SetUpBinding(TasksTableViewSource source) { var set = this.CreateBindingSet <NotDoneListItemView, NotDoneListItemViewModel>(); set.Bind(source).To(vm => vm.TaskCollection); set.Bind(source).For(v => v.SelectionChangedCommand).To(vm => vm.TaskViewCommand); set.Bind(_btnAdd).For("Clicked").To(vm => vm.ShowSecondPageCommand); set.Bind(_btnAdd).For("Enabled").To(vm => vm.IsNetChecking); set.Bind(_refreshControl).For(r => r.IsRefreshing).To(vm => vm.IsRefreshing); set.Bind(_refreshControl).For(r => r.RefreshCommand).To(vm => vm.RefreshCommand); set.Bind(netWork_label).For("Visibility").To(vm => vm.IsNetChecking).WithConversion("ReverseVisibility"); set.Apply(); }
public override void ViewDidLoad() { base.ViewDidLoad(); _refreshControl = new MvxUIRefreshControl(); DoneTasksTableView.AddSubview(_refreshControl); UIDevice.Notifications.ObserveOrientationDidChange(OrientationsHandler); netWork_button_constraint.Constant = TabBarController.TabBar.Frame.Size.Height; SetUpNavigationBar(); var source = new TasksTableViewSource(DoneTasksTableView); DoneTasksTableView.Source = source; SetUpBinding(source); DoneTasksTableView.ReloadData(); }