<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="ZipBrowser.MainPage" mc:Ignorable="d" FontFamily="Lucida Sans Unicode" FontSize="15" d:DesignHeight="300" d:DesignWidth="600" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:local="clr-namespace:ZipBrowser">

    <UserControl.Resources>
        <local:ZipItemBrushConverter x:Key="_cvt" />
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="LightYellow">
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" MinWidth="200" MaxWidth="300" />
            <ColumnDefinition Width="2*" />
        </Grid.ColumnDefinitions>
        
        <TextBlock Grid.ColumnSpan="2" FontSize="18" FontWeight="Bold" Text="ComponentOne Zip Browser" />
        
        <Grid Grid.Row="1" Grid.ColumnSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto" />
                <ColumnDefinition />
                <ColumnDefinition Width="auto" />
            </Grid.ColumnDefinitions>
            <TextBlock Text=" Zip Url: " VerticalAlignment="Center" />
            <c1:C1ComboBox Name="_urlCombo" Grid.Column="1" IsEditable="True" Text="https://gccontent.blob.core.windows.net/samples/Samples_2x/C1Report/Samples/C1Preview/CS/StickyNotes/StickyNotes.zip" KeyDown="_urlCombo_KeyDown" SelectedItemChanged="_urlCombo_SelectedItemChanged">
                <c1:C1ComboBox.Items>
                    <c1:C1ComboBoxItem Content="https://gccontent.blob.core.windows.net/samples/Samples_2x/C1Report/Samples/C1Preview/CS/StickyNotes/StickyNotes.zip" />
                    <c1:C1ComboBoxItem Content="https://gccontent.blob.core.windows.net/samples/Samples_3x/C1WPFScheduler/Samples/CS/Printing/Printing.zip" />
                    <c1:C1ComboBoxItem Content="https://gccontent.blob.core.windows.net/samples/Samples_3x/C1WebiPhone/Samples/CS/HowTo/SearchBox/SearchBox.zip" />
                    <c1:C1ComboBoxItem Content="https://gccontent.blob.core.windows.net/samples/silverlight/StockPortfolio/StockPortfolio.zip" />
                    <c1:C1ComboBoxItem Content="https://gccontent.blob.core.windows.net/samples/Samples_2x/C1FlexGridCF/Samples/VB/Analyze/Analyze/Analyze.zip" />
                </c1:C1ComboBox.Items>
            </c1:C1ComboBox>
            <Button Name="_btnLoad" Grid.Column="2" Content="Load..." Padding="8 0" Margin="4" Click="_btnLoad_Click" />
        </Grid>

        <c1:C1TreeView Name="_tree" Grid.Row="2" Margin="4" Background="LightYellow" BorderThickness="0" SelectionChanged="treeView1_SelectionChanged">
            <c1:C1TreeView.ItemTemplate>
                <c1:C1HierarchicalDataTemplate ItemsSource="{Binding Items}">
                    <Border Background="{Binding Converter={StaticResource _cvt}, ConverterParameter=bkg}" BorderBrush="{Binding Converter={StaticResource _cvt}, ConverterParameter=bdr}" BorderThickness="0 0 1 1" CornerRadius="6" Padding="5 0 10 0">
                        <TextBlock FontWeight="{Binding Converter={StaticResource _cvt}, ConverterParameter=fw}" Text="{Binding FileName}" />
                    </Border>
                </c1:C1HierarchicalDataTemplate>
            </c1:C1TreeView.ItemTemplate>
        </c1:C1TreeView>

        <local:ColorizedTextBox x:Name="_rtb" Grid.Row="2" Grid.Column="1" Margin="4" IsReadOnly="True" FontFamily="Lucida Sans Unicode" FontSize="15" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" />
        <Image Name="_img" Grid.Row="2" Grid.Column="1" Margin="10" Stretch="None" VerticalAlignment="Top" HorizontalAlignment="Left" Visibility="Collapsed" />
    </Grid>
</UserControl>