summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls/GalleryPages/CarouselPageGallery.cs
blob: 478b3018c5914ffc5547732a9eac6e9aedb11acb (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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xamarin.Forms.Controls
{

	public class CarouselPageGallery : CarouselPage
	{
		public CarouselPageGallery ()
		{
			var pageOneLabel = new Label {
				Text = "No click one"
			};

			var pageTwoLabel = new Label {
				Text = "No click two"
			};

			var pageThreeLabel = new Label {
				Text = "No click three"
			};

			var pageOneButton = new Button {
				Text = "Click me one",
				Command = new Command (() => pageOneLabel.Text = "Clicked one")
			};

			var pageTwoButton = new Button {
				Text = "Click me two",
				Command = new Command (() => pageTwoLabel.Text = "Clicked two")
			};

			var pageThreeButton = new Button {
				Text = "Click me three",
				Command = new Command (() => pageThreeLabel.Text = "Clicked three")
			};

			Children.Add (new ContentPage {
				Title = "Page One",
				BackgroundColor = new Color (1, 0, 0),
				Content = new StackLayout {
					Children = {
						pageOneLabel,
						pageOneButton
					}
				}
			});

			Children.Add (new ContentPage {
				Title = "Page Two",
				BackgroundColor = new Color (0, 1, 0),
				Content = new StackLayout {
					Children = {
						pageTwoLabel,
						pageTwoButton
					}
				}
			});

			Children.Add (new ContentPage {
				Title = "Page Three",
				BackgroundColor = new Color (0, 0, 1),
				Content = new StackLayout {
					Children = {
						pageThreeLabel,
						pageThreeButton
					}
				}
			});
		}
	}
}