summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1618.cs
blob: 48f519f6260027d2c21f0a80419e51476a82c475 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Linq;

using Xamarin.Forms.CustomAttributes;

namespace Xamarin.Forms.Controls
{
	[Preserve (AllMembers=true)]
	[Issue (IssueTracker.Github, 1618, "Horizontal ScrollView in ListView crashes", PlatformAffected.Android)]
	public class Issue1618
		: ContentPage
	{
		public Issue1618()
		{
			Content = new ListView {
				ItemsSource = Enumerable.Range(0, 100).Select (i => Enumerable.Repeat (i, 500).Aggregate (string.Empty, (s, n) => s += n + " ")),
				ItemTemplate = new DataTemplate (typeof (MyCell))
			};
		}

		class MyCell
			: ViewCell
		{
			public MyCell()
			{
				var scroll = new ScrollView {
					Orientation = ScrollOrientation.Horizontal,
					Content = new Label()
				};

				scroll.Content.SetBinding (Label.TextProperty, ".");

				View = scroll;
			}
		}
	}
}