Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 6006b0d

Browse files
authored
Check if Logical Child is VE in ListViewRenderer (#12057)
* Check if Logical Child is VE in ListViewRenderer * - keep around local children
1 parent 7483a99 commit 6006b0d

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

Xamarin.Forms.Core/ListView.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@ public class ListView : ItemsView<Cell>, IListViewController, IElementConfigurat
1717
{
1818
readonly List<Element> _logicalChildren = new List<Element>();
1919

20-
#if NETSTANDARD1_0
21-
ReadOnlyCollection<Element> _readOnlyLogicalChildren;
22-
internal override ReadOnlyCollection<Element> LogicalChildrenInternal => _readOnlyLogicalChildren ??
23-
(_readOnlyLogicalChildren = new ReadOnlyCollection<Element>(_logicalChildren));
24-
#else
25-
internal override ReadOnlyCollection<Element> LogicalChildrenInternal => _logicalChildren.AsReadOnly();
26-
#endif
27-
2820
public static readonly BindableProperty IsPullToRefreshEnabledProperty = BindableProperty.Create("IsPullToRefreshEnabled", typeof(bool), typeof(ListView), false);
2921

3022
public static readonly BindableProperty IsRefreshingProperty = BindableProperty.Create("IsRefreshing", typeof(bool), typeof(ListView), false, BindingMode.TwoWay);
@@ -60,7 +52,7 @@ public class ListView : ItemsView<Cell>, IListViewController, IElementConfigurat
6052
public static readonly BindableProperty SeparatorColorProperty = BindableProperty.Create("SeparatorColor", typeof(Color), typeof(ListView), Color.Default);
6153

6254
public static readonly BindableProperty RefreshControlColorProperty = BindableProperty.Create(nameof(RefreshControlColor), typeof(Color), typeof(ListView), Color.Default);
63-
55+
6456
public static readonly BindableProperty HorizontalScrollBarVisibilityProperty = BindableProperty.Create(nameof(HorizontalScrollBarVisibility), typeof(ScrollBarVisibility), typeof(ListView), ScrollBarVisibility.Default);
6557

6658
public static readonly BindableProperty VerticalScrollBarVisibilityProperty = BindableProperty.Create(nameof(VerticalScrollBarVisibility), typeof(ScrollBarVisibility), typeof(ListView), ScrollBarVisibility.Default);
@@ -408,7 +400,7 @@ protected override void UnhookContent(Cell content)
408400
if (content == null || !_logicalChildren.Contains(content))
409401
return;
410402
var index = _logicalChildren.IndexOf(content);
411-
_logicalChildren.Remove(content);
403+
_logicalChildren.Remove(content);
412404
content.Parent = null;
413405
VisualDiagnostics.OnChildRemoved(this, content, index);
414406

@@ -653,4 +645,4 @@ protected override bool ValidateItemTemplate(DataTemplate template)
653645
return true;
654646
}
655647
}
656-
}
648+
}

0 commit comments

Comments
 (0)