Skip to content

Instantly share code, notes, and snippets.

@jgold6
Created July 22, 2014 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgold6/9b95b6ae67a32ffa2705 to your computer and use it in GitHub Desktop.
Save jgold6/9b95b6ae67a32ffa2705 to your computer and use it in GitHub Desktop.
TableView1
public static Page GetMainPage()
{
return new NavigationPage (new ContentPage {
Content = new TableView {
Intent = TableIntent.Settings,
Root = new TableRoot ("Settings") {
new TableSection ("Notifications") {
new ViewCell {
View = new StackLayout {
Padding = new Thickness(20.0, 0.0, 0.0, 0.0),
VerticalOptions = LayoutOptions.Start,
Orientation = StackOrientation.Horizontal,
Children = {
new Label {Text = "Notifications", WidthRequest = 100.0, YAlign = TextAlignment.Center},
new StackLayout {HorizontalOptions = LayoutOptions.EndAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Orientation = StackOrientation.Vertical},
new Switch{IsToggled = true}
}
}
},
new ViewCell {
View = new StackLayout {
VerticalOptions = LayoutOptions.Start,
Orientation = StackOrientation.Horizontal,
Children = {
new Label {Text = "Max", WidthRequest = 100.0, YAlign = TextAlignment.Center},
new StackLayout {HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Orientation = StackOrientation.Vertical},
new Entry()
}
}
}
},
new TableSection ("Network") {
new TextCell {Text="To change a setting below, please change on your device.", IsEnabled = false},
new ViewCell {
View = new StackLayout {
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Children = {
new Label {Text = "IsWifi"}
}
}
},
new ViewCell {
View = new StackLayout {
Padding = new Thickness(20.0, 0.0, 0.0, 0.0),
VerticalOptions = LayoutOptions.Start,
Orientation = StackOrientation.Horizontal,
Children = {
new Label {Text = "IsWifi", WidthRequest = 100.0, YAlign = TextAlignment.Center},
new StackLayout {
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Orientation = StackOrientation.Vertical,
Children = {new Switch {IsToggled = false, IsEnabled = false}}
}
}
}
}
}
}
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment