Skip to content

Instantly share code, notes, and snippets.

@juucustodio
Created August 2, 2018 13:14
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 juucustodio/88cbe2cb2f8e04ed5ba5d68d518f3da5 to your computer and use it in GitHub Desktop.
Save juucustodio/88cbe2cb2f8e04ed5ba5d68d518f3da5 to your computer and use it in GitHub Desktop.
Example how to implement Master Detail menu in Xamarin.Forms Applications - http://julianocustodio.com/master-detail
<?xml version="1.0" encoding="utf-8" ?>
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MasterDetailDemo.Menu" Title="Master">
<MasterDetailPage.Master>
<ContentPage Title="Menu" Padding="0">
<ContentPage.Content>
<StackLayout>
<Grid BackgroundColor="#03A9F4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="10"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="80"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10"/>
</Grid.RowDefinitions>
<Label
Grid.Column="1"
Grid.Row="2"
Text="App Name"
TextColor="White" FontSize="Large"/>
</Grid>
<TableView Intent="Menu">
<TableSection>
<ViewCell Tapped="GoPage1">
<StackLayout Padding="15,10">
<Label Text="Page 1" VerticalTextAlignment="Center"/>
</StackLayout>
</ViewCell>
<ViewCell Tapped="GoPage2">
<StackLayout Padding="15,10">
<Label Text="Page 2" VerticalTextAlignment="Center"/>
</StackLayout>
</ViewCell>
<ViewCell Tapped="GoPage3">
<StackLayout Padding="15,10">
<Label Text="Page 3" VerticalTextAlignment="Center"/>
</StackLayout>
</ViewCell>
</TableSection>
</TableView>
</StackLayout>
</ContentPage.Content>
</ContentPage>
</MasterDetailPage.Master>
</MasterDetailPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment