blob: 25c2987ea703bd2cd822b3fca0e05e9fcc0c0770 (
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
|
using System;
using System.Collections;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
namespace Xamarin.Forms.Controls
{
// NavigationPage -> TabbedPage -> ContentPage
// Not recommended
public class RootNavigationTabbedContentPage : NavigationPage
{
public RootNavigationTabbedContentPage (string hierarchy)
{
AutomationId = hierarchy + "PageId";
var tabbedPage = new TabbedPage {
Children = {
new ContentPage {
Title = "Page 1",
Content = new SwapHierachyStackLayout (hierarchy)
},
new ContentPage {
Title = "Page 2",
Content = new StackLayout {
Children = {
new Label { Text = "Page Two" },
new BoxView {
Color = Color.Gray,
VerticalOptions = LayoutOptions.FillAndExpand,
HorizontalOptions = LayoutOptions.FillAndExpand
},
new Button { Text = "Click me" },
}
}
}
}
};
PushAsync (tabbedPage);
}
}
}
|