summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2294.cs
blob: abfa922057a7f7386b171720933b8eaf37dc5f3f (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using Xamarin.Forms;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

namespace Xamarin.Forms.Controls
{
	[Preserve (AllMembers=true)]
	[Issue (IssueTracker.Github, 2294, "Scrolling view causes timer to stop incrementing", PlatformAffected.iOS)]
	public class Issue2294 : ContentPage
	{
		public Issue2294 ()
		{
			var labelUpdatedByTimer = new Label{ };
			var layout = new StackLayout {
				Children = {
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					labelUpdatedByTimer,
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
					new Label {Text = "lots of content to scroll"},
				},
			};
			var scroll = new ScrollView {
				Content = layout,
			};
			double counter = 0.0;
			Device.StartTimer (TimeSpan.FromSeconds (0.02), () => {
				counter += 0.02;
				labelUpdatedByTimer.Text = counter.ToString();
				return true;
			});
			Content = scroll;
		}
	}
}