Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove incorrect call to DisconnectHandler #15036

Merged
merged 2 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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