MonoMobile.Views.DataContextBinder.ReplaceRow C# (CSharp) Method

ReplaceRow() private method

private ReplaceRow ( MonoMobile.Views.Section section, object oldItem, object newItem, UITableViewRowAnimation animation = UITableViewRowAnimation.Fade ) : void
section MonoMobile.Views.Section
oldItem object
newItem object
animation UITableViewRowAnimation
return void
		private void ReplaceRow(Section section, object oldItem, object newItem, UITableViewRowAnimation animation = UITableViewRowAnimation.Fade)
		{
			RemovePropertyChangedHandler(oldItem);
			AddPropertyChangedHandler(newItem);

			var row = section.DataContext.IndexOf(oldItem);

			section.DataContext[row] = newItem;
					
			if (Controller == MonoMobileApplication.CurrentViewController)
			{
				var indexPaths = new NSIndexPath[] { NSIndexPath.FromRowSection(row, section.Index) };
				InvokeOnMainThread(()=> Controller.TableView.ReloadRows(indexPaths, animation));
			}
		}
	}