summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs')
-rw-r--r--Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs b/Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs
index d5787865..44d86644 100644
--- a/Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs
+++ b/Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs
@@ -6,6 +6,7 @@ using Xamarin.Forms.ControlGallery.iOS;
using System.Collections.Generic;
using System.Linq;
using System.Drawing;
+using System.Collections;
#if __UNIFIED__
using UIKit;
@@ -324,12 +325,12 @@ namespace Xamarin.Forms.ControlGallery.iOS
public IEnumerable<DataSource> Items
{
//get{ }
- set { _tableItems = value.ToList(); }
+ set { _tableItems = new List<DataSource>(value); }
}
public NativeiOSListViewSource(NativeListView2 view)
{
- _tableItems = view.Items.ToList();
+ _tableItems = new List<DataSource>(view.Items);
_listView = view;
}
@@ -407,12 +408,13 @@ namespace Xamarin.Forms.ControlGallery.iOS
public IEnumerable<string> Items
{
- set { _tableItems = value.ToList(); }
+ set { _tableItems = new List<string>(value);
+ }
}
public NativeListViewSource(NativeListView view)
{
- _tableItems = view.Items.ToList();
+ _tableItems = new List<string>(view.Items);
_listView = view;
}
@@ -524,7 +526,10 @@ namespace Xamarin.Forms.ControlGallery.iOS
public CollectionViewController(UICollectionViewLayout layout, OnItemSelected onItemSelected) : base(layout)
{
- items = Enumerable.Range(0, 20).Select(c => $"#{c}").ToList();
+ items = new List<string>();
+ for (int i = 0; i < 20; i++) {
+ items.Add($"#{i}");
+ }
_onItemSelected = onItemSelected;
}