summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44338.cs
blob: 54fef8293985db27ce34f432856934bb2299fecf (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
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif

namespace Xamarin.Forms.Controls.Issues
{
	[Preserve(AllMembers = true)]
	[Issue(IssueTracker.Bugzilla, 44338, "Tapping off of a cell with an open context action causes a crash in iOS 10", PlatformAffected.iOS)]
	public class Bugzilla44338 : TestContentPage
	{
		protected override void Init()
		{
			string[] items = new string[] { "A", "B", "C" };
			Content = new ListView
			{
				ItemsSource = items,
				ItemTemplate = new DataTemplate(() =>
				{
					var label = new Label();
					label.SetBinding(Label.TextProperty, ".");
					var view = new ViewCell
					{
						View = new StackLayout
						{
							Children =
							{
								label
							}
						}
					};
					view.ContextActions.Add(new MenuItem
					{
						Text = "Action",
						Command = new Command(() => DisplayAlert("Alert", "Context Action Pressed", "Close"))
					});
					return view;
				})	
			};
		}
	}
}