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

namespace Xamarin.Forms.Controls
{
	public class MultiGallery : ContentPage
	{
		public MultiGallery ()
		{
			var button = new Button {Text = "Toggle Nav Bar"};
			Content = new ScrollView {
				Content = new StackLayout {
					Children = {
						button,
						new Editor (),
						new Entry (),
						new Image {Source = ImageSource.FromFile ("cover1.jpg")},
						new Label {Text = "Label"},
						new ProgressBar (),
						new ActivityIndicator (),
						new Switch (),
						new Stepper (),
						new Slider (),
						new ProgressBar (),
						new ActivityIndicator (),
						new Switch (),
						new Stepper (),
						new Slider ()
					}
				}
			};

			button.Clicked +=
				(sender, args) => NavigationPage.SetHasNavigationBar (this, !NavigationPage.GetHasNavigationBar (this));

			ToolbarItems.Add (new ToolbarItem ("Back", "bank.png", () => Navigation.PopAsync (), ToolbarItemOrder.Primary));
			ToolbarItems.Add (new ToolbarItem ("It's", "bank.png", () => Navigation.PopAsync (), ToolbarItemOrder.Secondary));
			ToolbarItems.Add (new ToolbarItem ("A", "bank.png", () => Navigation.PopAsync (), ToolbarItemOrder.Secondary));
			ToolbarItems.Add (new ToolbarItem ("TARP!", "bank.png", () => Navigation.PopAsync (), ToolbarItemOrder.Secondary));
		}

		protected override void OnAppearing ()
		{
			Debug.WriteLine ("Appearing");
			base.OnAppearing ();
		}

		protected override void OnDisappearing ()
		{
			Debug.WriteLine ("Disappearing");
			base.OnDisappearing ();
		}
	}
}