<Page
    x:Class="ZipSamples.DemoZip"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:flexGrid="using:C1.Xaml.FlexGrid"
    xmlns:c1="using:C1.Xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>
        <ResourceDictionary>
            <ResourceDictionary.ThemeDictionaries>
                <ResourceDictionary x:Key="Default">
                    <SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="#FF1D1D1D"/>
                </ResourceDictionary>
                <ResourceDictionary x:Key="Light">
                    <SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="#FFF2F2F2"/>
                </ResourceDictionary>
            </ResourceDictionary.ThemeDictionaries>
            <Style x:Key="TitleTextStyle" TargetType="TextBlock">
                <Setter Property="FontWeight" Value="Light" />
                <Setter Property="FontFamily" Value="Segoe UI Light" />
                <!--<Setter Property="Foreground" Value="White" />-->
                <Setter Property="FontSize" Value="28" />
            </Style>
            <Style TargetType="Button" >
                <Setter Property="Width" Value="160" />
                <Setter Property="Margin" Value="0 0 10 0" />
                <!--<Setter Property="Background" Value="Black" />-->
            </Style>
            <Style TargetType="StackPanel" >
                <Setter Property="Orientation" Value="Horizontal" />
                <!--<Setter Property="Background" Value="DarkGray" />-->
            </Style>
        </ResourceDictionary>
    </Page.Resources>

    <Grid Name="LayoutRoot" >
        <Grid Name="_mainpage">
        <Grid.RowDefinitions>
            <RowDefinition Height="60" />
            <RowDefinition Height="60" />
            <RowDefinition Height="60" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <c1:C1ProgressBar Width="400" Grid.ColumnSpan="3" Grid.RowSpan="4" Height="70"   Canvas.ZIndex="10"  x:Name="progressBar" HorizontalAlignment="Center" VerticalAlignment="Center" IndeterminateForeground="#FFB1356B" IsIndeterminate="True" Visibility="Collapsed"/>
        <Grid >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <!--<StackPanel Margin="50 0 0 0" >
                <Image Stretch="None" Source="Assets/C1Zip_48px.png" AutomationProperties.Name="Product Logo" HorizontalAlignment="Left" Margin="0 0 -5 0"/>
                <TextBlock Text="C1Zip"  Margin="15 0 0 0" VerticalAlignment="Center" Style="{StaticResource TitleTextStyle}" Name="FileName"/>
            </StackPanel>-->
            <StackPanel Grid.Row="0" Margin="0 0 50 0" Grid.Column="2" VerticalAlignment="Center">
                <TextBlock Text="Compress:" VerticalAlignment="Center" Margin="0,0,20,0" FontSize="16"/>
                <Button Name="_btnPickSingleFolder" Content="Pick Folder.." Click="_btnPickFolder_Click"/>
                <Button Name="_btnPickFiles" Content="Pick Files.." Click="_btnPickFiles_Click"/>
                <Button Name="_btnCompress"   Content="Compress.." Click="_btnCompress_Click" IsEnabled="False"/>
            </StackPanel>
        </Grid>
        <Grid   Grid.Row="1" Grid.Column="2">
            <StackPanel  Margin="0 0 50 0"  VerticalAlignment="Center" >
                <TextBlock Text="Extract:" VerticalAlignment="Center" Margin="0,0,43,0" FontSize="16" />
                <Button Name="_btnOpen" Content="Open Zip..." Click="_btnOpen_Click" />
                <Button Name="_btnExtract" Content="Extract All..." Click="_btnExtract_Click" IsEnabled="False"/>
            </StackPanel>
        </Grid>
        <Grid  Grid.Row="2" Grid.Column="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="125*"/>
                <ColumnDefinition Width="558*"/>
            </Grid.ColumnDefinitions>
            <StackPanel  VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Column="1">
                <Button Name="_btnRemove" Content="Remove" Click="_btnRemove_Click" IsEnabled="False" />
                <Button Name="_btnView" Content="View" Click="_btnView_Click" IsEnabled="False"/>
                <Button Name="_btnClear" Content="Clear" Click="_btnClear_Click" Margin="0" />
            </StackPanel>
        </Grid>
        <flexGrid:C1FlexGrid BorderBrush="Gray" BorderThickness="1"
            Name="_flex"
            Grid.Row="3"
            SelectionMode="Row"
            HeadersVisibility="Column"
            AllowResizing="Columns"
            HeaderGridLinesBrush="Transparent"
            AutoGenerateColumns="False" >
            <flexGrid:C1FlexGrid.Columns>
                <flexGrid:Column Binding="{Binding FileName}" Header="Name" Width="300"/>
                <flexGrid:Column Binding="{Binding Date}" Header="Date" Format="d" />
                <flexGrid:Column Binding="{Binding SizeUncompressedLong}" Header="Size" Format="n0" />
                <flexGrid:Column Binding="{Binding SizeCompressedLong}" Header="Compressed" Format="n0" />
                <flexGrid:Column Binding="{Binding CompressionRatio}" Header="Ratio" Format="p0" />
                <flexGrid:Column Binding="{Binding CRC32}" Header="CRC" Format="x0" />
                <flexGrid:Column Binding="{Binding Attributes}" Header="Attributes" />
            </flexGrid:C1FlexGrid.Columns>
        </flexGrid:C1FlexGrid>
        </Grid>
        <Grid 
            Name="_preview"
            Grid.RowSpan="4" 
            Visibility="Collapsed" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition />
            </Grid.RowDefinitions>

            <Grid Margin="0 0 0 20">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <TextBlock Text="C1Zip Preview" FontSize="28" Margin="0 0 40 0"/>
                <Button Grid.Column="1" Name="_btnClosePreview" Content="Close" Click="_btnClosePreview_Click_1" HorizontalAlignment="Right" Margin="0" Width="106"/>
            </Grid>

            <TextBox 
                Grid.Row="1" 
                Name="_tbContent" 
                IsReadOnly="True" 
                AcceptsReturn="True" 
                FontFamily="Courier New" 
                Background="White" />
        </Grid>
    </Grid>
</Page>
