Skip to content

Instantly share code, notes, and snippets.

@JoeM-RP
Last active April 30, 2018 20:40
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 JoeM-RP/21d85052c620a329e63c43aac3a1fadb to your computer and use it in GitHub Desktop.
Save JoeM-RP/21d85052c620a329e63c43aac3a1fadb 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="samples.core.Views.RadioButtonView" xmlns:behaviors="clr-namespace:samples.core.Behaviors" Title="Radio Buttons">
<ListView x:Name="ListView_Radio" ItemTapped="Handle_ItemTapped" ItemSelected="Handle_ItemSelected" IsGroupingEnabled="true" HasUnevenRows="true">
<!-- Group Header -->
<ListView.GroupHeaderTemplate>
<DataTemplate>
<ViewCell>
<StackLayout BackgroundColor="{StaticResource MediumGray}">
<Label Margin="14,0" Text="{Binding Key}" FontSize="Large" VerticalOptions="CenterAndExpand"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.GroupHeaderTemplate>
<!--- Item Template -->
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal">
<Label Margin="14,10" Text="{Binding Title}" FontSize="Large" VerticalTextAlignment="Center" HorizontalOptions="Start"/>
<Grid HorizontalOptions="EndAndExpand" Margin="14,0">
<Label Text="○" FontSize="20" TextColor="{StaticResource MediumGray}" VerticalTextAlignment="Center"/>
<Label Text="●" FontSize="20" TextColor="{StaticResource BrandColor}" IsVisible="{Binding IsSelected}" VerticalTextAlignment="Center" />
</Grid>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
<!-- Footer -->
<ListView.Footer>
<StackLayout Margin="10,15">
<Button Text="Apply" HorizontalOptions="Center" WidthRequest="150" Clicked="Handle_Clicked"/>
</StackLayout>
</ListView.Footer>
</ListView>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment