summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls/RootPages/RootTabbedMDPNavigationContentPage.cs
blob: 14bf7cf1efdc5b3f3e8e8c20c482dd1a38650311 (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
using System;
using System.Collections;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;

namespace Xamarin.Forms.Controls
{
	//TabbedPage -> MasterDetailPage -> NavigationPage -> ContentPage
	public class RootTabbedMDPNavigationContentPage : TabbedPage 
	{
		public RootTabbedMDPNavigationContentPage (string hierarchy) 
		{
			AutomationId = hierarchy + "PageId";

			var tabOne = new MasterDetailPage {
				Title = "Testing 123",
				Master = new ContentPage {
					Title = "Testing 123",
					Content = new StackLayout {
						Children = {
								new Label {Text = "Master"},
								new AbsoluteLayout {
									BackgroundColor = Color.Red,
									VerticalOptions = LayoutOptions.FillAndExpand,
									HorizontalOptions = LayoutOptions.FillAndExpand
								},
								new Button {Text = "Button"}
							}
					}
				},
				Detail = new NavigationPage (new ContentPage {
					Title = "Testing 123",
					Content = new SwapHierachyStackLayout (hierarchy)
				})
			};

			var tabTwo = new ContentPage {
				Title = "Testing 345",
				Content = new StackLayout {
					Children = {
						new Label { Text = "Hello" },
						new AbsoluteLayout {
							BackgroundColor = Color.Red,
							VerticalOptions = LayoutOptions.FillAndExpand,
							HorizontalOptions = LayoutOptions.FillAndExpand
						}
					}
				}
			};

			Children.Add (tabOne);
			Children.Add (tabTwo);
		}
	}
}