summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1538.cs
blob: 683cc7a8572bd7ddc49b4b606a9b9f090661bc01 (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
using System;
using System.Threading.Tasks;

using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

namespace Xamarin.Forms.Controls
{
	[Preserve (AllMembers=true)]
	[Issue (IssueTracker.Github, 1538, "Crash measuring empty ScrollView", PlatformAffected.Android | PlatformAffected.WinPhone)]
	public class Issue1538 : ContentPage
	{
		ScrollView _sv;
		public Issue1538 ()
		{
			StackLayout sl = new StackLayout(){VerticalOptions = LayoutOptions.FillAndExpand};
			sl.Children.Add( _sv = new ScrollView(){HeightRequest=100} );
			Content = sl;

			AddContentDelayed ();
		}

		async void AddContentDelayed ()
		{
			await Task.Delay (1000);
			_sv.Content = new Label { Text = "Foo" };
		}
	}
}