summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2282.xaml.cs
blob: 1db3b1105992fbbfbe90ba8705b34add94831472 (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
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

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

namespace Xamarin.Forms.Controls.TestCasesPages
{
#if APP
	[Preserve (AllMembers = true)]
	[Issue (IssueTracker.Github, 2282, "ListView ItemTapped issue on Windows phone", PlatformAffected.WinPhone)]
	public partial class Issue2282 : ContentPage
	{
		public Issue2282 ()
		{
			Items = new ObservableCollection<string>();
			InitializeComponent();

			BindingContext = Items;
			MyListView.ItemTapped += (sender, e) => {
				LogLabel.Text = string.Format("{0} - Item {1} Tapped!", _counter++, (string)e.Item);
			};
		}

		public ObservableCollection<string> Items { get; set; }

		int _counter = 0;

		protected override void OnAppearing()
		{
			Items.Add("First");
			Items.Add("Second");
			Items.Add("Third");
			base.OnAppearing();
		}
	}
#endif
}