<Page
    x:Class="BasicLibrarySamples.View.BindingToC1CollectionView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:BasicLibrarySamples.View.C1CollectionView"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <!--<Border BorderThickness="0,1,0,1" BorderBrush="White" Padding="5">
            <StackPanel Orientation="Horizontal">
                <CheckBox Name="filterCheckBox" Content="Filter on Active" IsThreeState="True" IsChecked="{x:Null}" 
                          Click="filterCheckBox_Click_1"/>
            </StackPanel>
        </Border>-->
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="300"/>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition />
            </Grid.RowDefinitions>

            <!-- ListBox -->
            <TextBlock Text="Grouped ListBox" FontSize="18" Padding="0 5 5 5"/>
            <ListBox Name="listBox1" Grid.Row="1" Background="Transparent" BorderThickness="0">
                <ListBox.GroupStyle>
                    <GroupStyle>
                        <GroupStyle.HeaderTemplate>
                            <DataTemplate>
                                <Border MinHeight="20" MinWidth="70" 
                                        Background="{StaticResource ListViewItemOverlayBackgroundThemeBrush }" Padding="5">
                                    <TextBlock Text="{Binding}" Foreground="White" />
                                </Border>
                            </DataTemplate>
                        </GroupStyle.HeaderTemplate>
                    </GroupStyle>
                </ListBox.GroupStyle>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Border>
                            <StackPanel Orientation="Horizontal">
                                <CheckBox IsChecked="{Binding Active}" IsEnabled="False"/>
                                <TextBlock Text="{Binding Name}"/>
                                <TextBlock Text=" from&#160;"/>
                                <TextBlock Text="{Binding Country}"/>
                            </StackPanel>
                        </Border>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

            <!-- GridView -->
            <TextBlock Text="Grouped GridView" Grid.Column="1" FontSize="18" Padding="10 5 5 5"/>
            <GridView Name="gridView1" Grid.Row="1" Grid.Column="1" Margin="10,0,0,0">
                <GridView.GroupStyle>
                    <GroupStyle>
                        <GroupStyle.HeaderTemplate>
                            <DataTemplate>
                                <Border MinHeight="20" MinWidth="70" 
                                        Background="#FF959595" Padding="5">
                                    <TextBlock Text="{Binding}" Foreground="White" VerticalAlignment="Center"/>
                                </Border>
                            </DataTemplate>
                        </GroupStyle.HeaderTemplate>
                        
                        <GroupStyle.Panel>
                            <ItemsPanelTemplate>
                                <VariableSizedWrapGrid Orientation="Vertical" Height="400" />
                            </ItemsPanelTemplate>
                        </GroupStyle.Panel>
                    </GroupStyle>
                </GridView.GroupStyle>
                
                <GridView.ItemTemplate>
                    <DataTemplate>
                        <Grid Width="200" HorizontalAlignment="Left">
                            <StackPanel Orientation="Horizontal">
                                <CheckBox Grid.Column="1" IsChecked="{Binding Active}" IsEnabled="False"/>
                                <TextBlock Text="{Binding Name}"/>
                                <TextBlock Text=",&#160;"/>
                                <TextBlock Text="{Binding Country}"/>
                            </StackPanel>
                        </Grid>
                    </DataTemplate>
                </GridView.ItemTemplate>
            </GridView>
        </Grid>
    </Grid>
</Page>