Skip to content

Commit

Permalink
Remove incorrect call to DisconnectHandler (#15036)
Browse files Browse the repository at this point in the history
  • Loading branch information
PureWeen authored and rmarinho committed May 30, 2023
1 parent 94fde2b commit ae41643
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ internal static UITableViewCell GetPlatformCell(UITableView tableView, Cell cell
else
reusableCell = tableView.DequeueReusableCell(id);

cell.Handler?.DisconnectHandler();
cell.ReusableCell = reusableCell;
cell.TableView = tableView;
var handler = cell.ToHandler(cell.FindMauiContext());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ IPlatformViewHandler GetNewRenderer()

var newRenderer = _viewCell.View.ToHandler(_viewCell.View.FindMauiContext());
_rendererRef = new WeakReference<IPlatformViewHandler>(newRenderer);
ContentView.AddSubview(newRenderer.PlatformView);
ContentView.ClearSubviews();
ContentView.AddSubview(newRenderer.VirtualView.ToPlatform());
return (IPlatformViewHandler)newRenderer;
}

Expand All @@ -187,6 +188,14 @@ void UpdateCell(ViewCell cell)
}

_viewCell = cell;

if (cell is null)
{
_rendererRef = null;
ContentView.ClearSubviews();
return;
}

_viewCell.PropertyChanged += ViewCellPropertyChanged;
BeginInvokeOnMainThread(_viewCell.SendAppearing);

Expand Down

0 comments on commit ae41643

Please sign in to comment.