private void TextViewTextChanged(object sender, EventArgs e) { if (_outputCount > 0) { return; } var updateScheduler = UpdateScheduler.Begin(); try { _input(_converter.ConvertInput(_control.Text)); } finally { if (updateScheduler != null) { _inputCount++; try { foreach (var update in updateScheduler.End()) { update(); } } finally { _inputCount--; } } } }
public override void OnUserInput(object value) { if (NotificationGate.IsInbound) { var scheduler = UpdateScheduler.Begin(); try { value = TranslateIncommingValue(value); ClassProperty.SetObjectValue(ObjectInstance.WrappedObject, value); } finally { if (scheduler != null) { using (NotificationGate.BeginOutbound()) { foreach (IUpdatable updatable in scheduler.End()) { updatable.UpdateNow(); } } } } } }
public override void OnUserInput(object value) { if (NotificationGate.IsInbound) { var scheduler = UpdateScheduler.Begin(); try { if (_hasChildObject && value != null) { value = ((IObjectInstance)value).WrappedObject; } ClassProperty.SetObjectValue(ObjectInstance.WrappedObject, value); } finally { if (scheduler != null) { using (NotificationGate.BeginOutbound()) { foreach (Action updatable in scheduler.End()) { updatable(); } } } } } }
public override View GetView(int position, View convertView, ViewGroup parent) { var itemContainer = GetItem(position); if (itemContainer.View != null) { return(itemContainer.View); } var inflater = (LayoutInflater)Context.GetSystemService( Context.LayoutInflaterService); var row = inflater.Inflate(_resourceId, parent, attachToRoot: false); var scheduler = UpdateScheduler.Begin(); try { _bind(row, itemContainer.Item, itemContainer.Bindings); } finally { if (scheduler != null) { foreach (var update in scheduler.End()) { update(); } } } itemContainer.View = row; return(row); }
public void Execute(object parameter) { var scheduler = UpdateScheduler.Begin(); try { BindingInterceptor.Current.Execute(this, parameter); } finally { if (scheduler != null) { foreach (var updatable in scheduler.End()) { updatable(); } } } }
protected override void SetValue(object value) { var scheduler = UpdateScheduler.Begin(); try { value = TranslateIncommingValue(value); ClassProperty.SetObjectValue(ObjectInstance.WrappedObject, value); } finally { if (scheduler != null) { foreach (IUpdatable updatable in scheduler.End()) { updatable.UpdateNow(); } } } }
public override void SetValue(object value) { var scheduler = UpdateScheduler.Begin(); try { value = UnwrapValue(value); Member.SetValue(Instance, value); } finally { if (scheduler != null) { foreach (Action updatable in scheduler.End()) { updatable(); } } } }
public void Execute(object parameter) { var scheduler = UpdateScheduler.Begin(); try { // Execute the command. _execute(); } finally { if (scheduler != null) { foreach (var updatable in scheduler.End()) { updatable.UpdateNow(); } } } }
public void SetValue(object value) { var affectedSet = UpdateScheduler.Begin(); try { if (!_provider.IsCollection && _propertyInfo.CanWrite) { _propertyInfo.SetValue(_wrappedObject, UnwrapValue(value), EmptyIndexer); } } finally { if (affectedSet != null) { foreach (var updatable in affectedSet.End()) { updatable.UpdateNow(); } } } }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var itemContainer = _itemContainers[indexPath.Row]; itemContainer.Bindings.Unbind(); UITableViewCell cell = _tableView.DequeueReusableCell("TableCell"); // if there are no cells to reuse, create a new one if (cell == null) { cell = new UITableViewCell(UITableViewCellStyle.Default, "TableCell"); } var scheduler = UpdateScheduler.Begin(); _bind(cell, itemContainer.Item, itemContainer.Bindings); foreach (var update in scheduler.End()) { update(); } return(cell); }