summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls/GalleryPages/CellsGalleries/EntryCellTablePage.cs
blob: c37dd441781a264bf9265b4aaa164d5a107aa6ed (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
namespace Xamarin.Forms.Controls
{
	public class EntryCellTablePage : ContentPage
	{
		public EntryCellTablePage ()
		{
			Title = "EntryCell Table Gallery - Legacy";

			Device.OnPlatform (iOS: () => {
				if (Device.Idiom == TargetIdiom.Tablet) {
					Padding = new Thickness (0, 0, 0, 60);
				}
			});

			int timesEntered = 1;

			var entryCell = new EntryCell { Label = "Enter text", Placeholder = "I am a placeholder" };
			entryCell.Completed += (sender, args) => {
				((EntryCell)sender).Label = "Entered: " + timesEntered;
				timesEntered++;
			};

			var tableSection = new TableSection ("Section One") {
				new EntryCell { Label = "disabled", Placeholder = "disabled", IsEnabled = false },
				new EntryCell { Label = "Text 2" },
				new EntryCell { Label = "Text 3", Placeholder = "Placeholder 2" },
				new EntryCell { Label = "Text 4" },
				new EntryCell { Label = "Text 5", Placeholder = "Placeholder 3" },
				new EntryCell { Label = "Text 6" },
				new EntryCell { Label = "Text 7", Placeholder = "Placeholder 4" },
				new EntryCell { Label = "Text 8" },
				new EntryCell { Label = "Text 9", Placeholder = "Placeholder 5" },
				new EntryCell { Label = "Text 10" },
				new EntryCell { Label = "Text 11", Placeholder = "Placeholder 6" },
				new EntryCell { Label = "Text 12" },
				new EntryCell { Label = "Text 13", Placeholder = "Placeholder 7" },
				new EntryCell { Label = "Text 14" },
				new EntryCell { Label = "Text 15", Placeholder = "Placeholder 8" },
				new EntryCell { Label = "Text 16" },
				entryCell
			};

			var tableSectionTwo = new TableSection ("Section Two") {
				new EntryCell { Label = "Text 17", Placeholder = "Placeholder 9" },
				new EntryCell { Label = "Text 18" },
				new EntryCell { Label = "Text 19", Placeholder = "Placeholder 10" },
				new EntryCell { Label = "Text 20" },
				new EntryCell { Label = "Text 21", Placeholder = "Placeholder 11" },
				new EntryCell { Label = "Text 22" },
				new EntryCell { Label = "Text 23", Placeholder = "Placeholder 12" },
				new EntryCell { Label = "Text 24" },
				new EntryCell { Label = "Text 25", Placeholder = "Placeholder 13" },
				new EntryCell { Label = "Text 26" },
				new EntryCell { Label = "Text 27", Placeholder = "Placeholder 14" },
				new EntryCell { Label = "Text 28" },
				new EntryCell { Label = "Text 29", Placeholder = "Placeholder 15" },
				new EntryCell { Label = "Text 30" },
				new EntryCell { Label = "Text 31", Placeholder = "Placeholder 16" },
				new EntryCell { Label = "Text 32" },
			};

			var keyboards = new TableSection ("Keyboards") {
				new EntryCell { Label = "Chat", Keyboard = Keyboard.Chat },
				new EntryCell { Label = "Default", Keyboard = Keyboard.Default },
				new EntryCell { Label = "Email", Keyboard = Keyboard.Email },
				new EntryCell { Label = "Numeric", Keyboard = Keyboard.Numeric },
				new EntryCell { Label = "Telephone", Keyboard = Keyboard.Telephone },
				new EntryCell { Label = "Text", Keyboard = Keyboard.Text },
				new EntryCell { Label = "Url", Keyboard = Keyboard.Url }
			};

			var root = new TableRoot ("Text Cell table") {
				tableSection,
				tableSectionTwo,
				keyboards
			};

			var table = new TableView {
				Root = root
			};

			Content = table;
		}
	}
}