Skip to content

Instantly share code, notes, and snippets.

@rdelrosario
Created April 28, 2021 16:06
Show Gist options
  • Save rdelrosario/1b172de41aefb9751239fa510f0abec9 to your computer and use it in GitHub Desktop.
Save rdelrosario/1b172de41aefb9751239fa510f0abec9 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="DynamicDataGroupingSample.NotificationConfigurationsPage"
Title="Notification Settings">
<CollectionView ItemsSource="{Binding NotificationGroups}"
IsGrouped="True">
<CollectionView.GroupHeaderTemplate>
<DataTemplate>
<Label Padding="10"
Text="{Binding Key}"
BackgroundColor="CornflowerBlue"
FontSize="Large" />
</DataTemplate>
</CollectionView.GroupHeaderTemplate>
<CollectionView.ItemTemplate>
<DataTemplate>
<StackLayout>
<Label Text="{Binding Name}" FontSize="Large" TextDecorations="Underline" />
<Grid RowDefinitions="Auto, Auto" ColumnDefinitions="*, *, *, *">
<Label Grid.Column="0" Grid.Row="0" Text="Sms" />
<CheckBox Grid.Column="0" Grid.Row="1" IsChecked="{Binding SmsChannel}"/>
<Label Grid.Column="1" Grid.Row="0" Text="Email" />
<CheckBox Grid.Column="1" Grid.Row="1" IsChecked="{Binding EmailChannel}"/>
<Label Grid.Column="2" Grid.Row="0" Text="Push" />
<CheckBox Grid.Column="2" Grid.Row="1" IsChecked="{Binding PushNotificationChannel}"/>
<Label Grid.Column="3" Grid.Row="0" Text="Phone" />
<CheckBox Grid.Column="3" Grid.Row="1" IsChecked="{Binding PhoneChannel}"/>
</Grid>
</StackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment