summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls/GalleryPages/StepperGallery.cs
blob: 6da9bba4fc1f1e54a59e446e7e162da373180b07 (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
using System;

namespace Xamarin.Forms.Controls
{
	public class StepperGallery : ContentPage
	{
		public StepperGallery ()
		{
			var stepper = new Stepper {
				Minimum = 0,
				Maximum = 100,
				Increment = 10
			};

			var label = new Label {
				Text = stepper.Value.ToString()
			};

			stepper.ValueChanged += (s, e) => {
				label.Text = e.NewValue.ToString();
			};

			var stepperTwo = new Stepper {
				Minimum = 0.0,
				Maximum = 1.0,
				Increment = 0.05
			};

			var labelTwo = new Label {
				Text = stepperTwo.Value.ToString ()
			};

			stepperTwo.ValueChanged += (s, e) => {
				labelTwo.Text = e.NewValue.ToString ();
			};

			Content = new StackLayout {
				Padding = new Thickness (20),
				Children = {
					stepper,
					label,
					stepperTwo,
					labelTwo
				}
			};
		}
	}
}