public DataBindableListAdapter(LayoutInflater layoutInflater, int itemTemplateResourceId, string idPrefix, int?itemValueResourceId = null, ViewDataBindings.IViewExtensionPoints viewExtensionPoints = null) { if (layoutInflater == null) { throw new ArgumentNullException("layoutInflater"); } this.layoutInflater = layoutInflater; this.itemTemplateResourceId = itemTemplateResourceId; this.idPrefix = idPrefix; this.itemValueResourceId = itemValueResourceId; this.viewExtensionPoints = viewExtensionPoints; }
public DataBindableUITableViewSource(UITableView tableView, string cellIdentifier, ViewModelBase viewModel = null, string canEdit = null, string canMove = null, string rowSelectedPropertyName = null, string deleteRowCommandName = null, string insertRowCommandName = null, ViewDataBindings.IViewExtensionPoints viewExtensionPoints = null) { this.tableView = tableView; this.cellIdentifier = new NSString(cellIdentifier); this.viewModel = viewModel; this.canEdit = canEdit; this.canMove = canMove; this.viewExtensionPoints = viewExtensionPoints; this.rowSelectedPropertyName = rowSelectedPropertyName; this.deleteRowCommandName = deleteRowCommandName; this.insertRowCommandName = insertRowCommandName; if (this.rowSelectedPropertyName != null) { this.rowSelectedPropertyIsCommand = this.viewModel.CommandNames.Contains(this.rowSelectedPropertyName); } }
public ViewDataBindingsHolder(UIView rootView, ViewModelBase viewModel, string idPrefix, ViewDataBindings.IViewExtensionPoints viewExtensionPoints = null) { this.viewModel = viewModel; bindings = new ViewDataBindings(viewModel, idPrefix, viewExtensionPoints); List <BindingParameters> bindingParametersList; if (ViewDataBindings.RootViewBindingParameters.TryGetValue(rootView, out bindingParametersList)) { Console.WriteLine("Adding cell bindings from markup ..."); ViewDataBindings.RootViewBindingParameters.Remove(rootView); // Remove the static reference to the views to prevent memory leaks. Note that if we would want to recreate the bindings later, we could also store the parameters list in the bindings. bindings.AddBindings(bindingParametersList.ToArray()); } AddHandlers(); viewModel.RaisePropertiesChanged(); }
public ViewDataBindingsHolder(View rootView, ViewModelBase viewModel, LayoutInflater layoutInflater, string idPrefix, ViewDataBindings.IViewExtensionPoints viewExtensionPoints) { this.viewModel = viewModel; bindings = new ViewDataBindings(rootView, viewModel, layoutInflater, idPrefix, viewExtensionPoints); bindings.EnsureCommandBindings(); // Then add any command bindings that were not specified in code (based on the Id naming convention) AddHandlers(); viewModel.RaisePropertiesChanged(); }