<UserControl x:Class="FlexGridSamples.MediaLibrary"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="using:FlexGridSamples"
             xmlns:c1="using:C1.Xaml.FlexGrid">
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
      <RowDefinition />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
      <ColumnDefinition />
      <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>

        <Grid Grid.Row="1">
      <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition Width="Auto"/>
      </Grid.ColumnDefinitions>
      <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
        <TextBlock Text="Media Library: " FontSize="14"/>
        <TextBlock x:Name="_txtSongs" Text="Songs" FontSize="14"/>
      </StackPanel>
      <local:SearchBox
          x:Name="_srchMedia" Grid.Column="1"
          Margin="10" 
          HorizontalAlignment="Right" />
    </Grid>
      
    <StackPanel 
      Orientation="Horizontal" Grid.ColumnSpan="2"
      HorizontalAlignment="Left" 
      Margin="0,0,0,20" >
      <CheckBox 
        x:Name="_chkOwnerDraw" 
        VerticalAlignment="Center" 
        Content="Custom Cells " 
        IsChecked="true" 
        Click="_chkOwnerDraw_Click"/>
    </StackPanel>

    <!-- show songs in a FlexGrid -->
    <c1:C1FlexGrid x:Name="_flexMedia" 
                   Grid.Row="2"
                   IsReadOnly="true"
                   HeadersVisibility="Column"
                   GridLinesVisibility="None"
                   MinColumnWidth="35"
                   MinRowHeight="35"
                   SelectionMode="Row"
                   SelectionBackground="#FF0AC2FF"
                   CursorBackground="#FF0AC2FF"
                   AutoGenerateColumns="False"
                   BorderThickness="1">
      <c1:C1FlexGrid.Columns>
        <c1:Column Binding="{Binding Name}" Header="Title" AllowDragging="False" Width="300" />
        <c1:Column Binding="{Binding Duration}" />
        <c1:Column Binding="{Binding Size}"  />
        <c1:Column Binding="{Binding Rating, Mode=TwoWay}" Width="200" />
      </c1:C1FlexGrid.Columns>
    </c1:C1FlexGrid>

        <!-- progressbar above all other content -->
        <ProgressBar 
            Name="_progressBar"
            IsIndeterminate="True" Width="400" Height="4" Grid.ColumnSpan="2" Grid.RowSpan="3"/>

    </Grid>
</UserControl>
