Skip to content

Instantly share code, notes, and snippets.

@jlucaspains
Last active July 29, 2018 23:35
Show Gist options
  • Save jlucaspains/f6ef3e9c1aee12db3dabe3ed1924a4a9 to your computer and use it in GitHub Desktop.
Save jlucaspains/f6ef3e9c1aee12db3dabe3ed1924a4a9 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="lpains.Views.MasterView"
Title="Menu">
<ContentPage.Resources>
<Style x:Key="IconFA" TargetType="Label">
<Setter Property="Margin" Value="5,5,5,5"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="WidthRequest" Value="27"/>
<Setter Property="VerticalTextAlignment" Value="Center"/>
<Setter Property="HorizontalTextAlignment" Value="Center"/>
<Setter Property="VerticalOptions" Value="Center"/>
<Setter Property="FontFamily">
<Setter.Value>
<OnPlatform x:TypeArguments="x:String"
iOS="FontAwesome"
WinPhone="/Assets/Fonts/FontAwesome.ttf#FontAwesome"
Android="FontAwesome.ttf#FontAwesome">
</OnPlatform>
</Setter.Value>
</Setter>
</Style>
</ContentPage.Resources>
<ListView x:Name="ListView" SeparatorVisibility="None" VerticalOptions="FillAndExpand" GroupDisplayBinding="{Binding Key}"
HasUnevenRows="True" IsGroupingEnabled="True" SelectionMode="None">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal" HeightRequest="42" Padding="16, 0, 8, 0">
<Label Text="{Binding Icon}" Style="{StaticResource IconFA}"></Label>
<Label Text="{Binding Title}" FontSize="Small" Opacity="0.87" VerticalTextAlignment="Center"></Label>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.GroupHeaderTemplate>
<DataTemplate>
<ViewCell>
<Label Text="{Binding Key}" FontSize="Micro" Opacity="0.87" VerticalTextAlignment="Center" Margin="10, 0, 8, 0"></Label>
</ViewCell>
</DataTemplate>
</ListView.GroupHeaderTemplate>
</ListView>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment