Unsubscribe from IDefinition.SizeChanged event when set via indexer (#1014)
* Unsubscribe from IDefinition.SizeChanged event when set via indexer * added bounds and null check to preserve original exception * index check for negative values
This commit is contained in:
Родитель
4e4da6fee5
Коммит
3b11401558
|
@ -83,6 +83,9 @@ namespace Xamarin.Forms
|
|||
get { return _internalList[index]; }
|
||||
set
|
||||
{
|
||||
if(index < _internalList.Count && _internalList[index] != null && index >= 0)
|
||||
_internalList[index].SizeChanged -= OnItemSizeChanged;
|
||||
|
||||
_internalList[index] = value;
|
||||
value.SizeChanged += OnItemSizeChanged;
|
||||
OnItemSizeChanged(this, EventArgs.Empty);
|
||||
|
@ -106,4 +109,4 @@ namespace Xamarin.Forms
|
|||
eh(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче