attempt to properly unsubscribe the click handler for List cells.
This commit is contained in:
parent
089186c699
commit
50d6807a95
|
@ -48,6 +48,8 @@ namespace Ooui.Forms.Renderers
|
|||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
UnsubscribeCellClicks();
|
||||
|
||||
base.Dispose(disposing);
|
||||
|
||||
if (disposing && !_disposed)
|
||||
|
@ -56,8 +58,17 @@ namespace Ooui.Forms.Renderers
|
|||
}
|
||||
}
|
||||
|
||||
private void UnsubscribeCellClicks()
|
||||
{
|
||||
foreach (var c in _cells)
|
||||
{
|
||||
c.Click -= ListItem_Click;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateItems()
|
||||
{
|
||||
UnsubscribeCellClicks();
|
||||
_cells.Clear();
|
||||
|
||||
var items = TemplatedItemsView.TemplatedItems;
|
||||
|
|
Loading…
Reference in New Issue