<Window x:Class="C1FlexReportExplorer.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:clr="clr-namespace:System;assembly=mscorlib"
        xmlns:local="clr-namespace:C1FlexReportExplorer"
        xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
        mc:Ignorable="d"
        Title="C1FlexReportExplorer" 
        WindowStartupLocation="CenterScreen" 
        WindowState="Maximized">

    <Window.Resources>
        <clr:String x:Key="ReportList">Reports</clr:String>
    </Window.Resources>

    <Grid >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <DockPanel>
            <c1:C1DockControl DockPanel.Dock="Left" Margin="0" x:Name="dockControl"  HorizontalAlignment="Left" Width="320" MaxWidth="320" SlidingOpened="DockControl_SlidingOpened">
                <c1:C1DockGroup >
                    <c1:C1DockTabControl x:Name="sliding" DockMode="Docked" Dock="Left" ShowMenu="False" ShowSingleTab="False" TabStripBackground="WhiteSmoke" ShowHeader="False" >
                        <c1:C1DockTabItem x:Name="tabItem" Header="{StaticResource ReportList}" Visibility="Visible" TabShape="Rounded" >
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="30"></RowDefinition>
                                    <RowDefinition Height="*"></RowDefinition>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="285"/>
                                    <ColumnDefinition Width="55"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <TextBlock Grid.Row="0" Grid.Column="0" Text="{StaticResource ReportList}" FontSize="15" Background="WhiteSmoke" Padding="10,4,0,0"></TextBlock>
                                <Button Click="Button_Click" Grid.Row="0" Grid.Column="1" BorderThickness="0" Background="WhiteSmoke" Padding="4" HorizontalAlignment="Left" HorizontalContentAlignment="Left" Margin="0">
                                    <Viewbox RenderTransformOrigin="0.5,0.5" Margin="0">
                                        <Viewbox.RenderTransform>
                                            <RotateTransform Angle="180"/>
                                        </Viewbox.RenderTransform>
                                        <Canvas Width="100" Height="100">
                                            <Path Fill="SlateGray" Data="M28.438,86.735C27.271,85.568,27.271,83.659,28.438,82.493L65.186,45.743C66.353,44.576,68.262,44.576,69.428,45.743L71.563,47.878C72.729,49.045,72.73,50.954,71.563,52.12L34.814,88.87C33.647,90.036,31.738,90.037,30.572,88.87L28.438,86.735z">
                                            </Path>
                                            <Path Fill="SlateGray" Data="M69.43,54.255C68.263,55.422,66.354,55.422,65.188,54.255L28.437,17.507C27.27,16.34,27.27,14.431,28.437,13.265L30.571,11.13C31.738,9.963,33.647,9.963,34.814,11.13L71.565,47.878C72.731,49.045,72.732,50.953,71.565,52.12L69.43,54.255z">
                                            </Path>
                                        </Canvas>
                                    </Viewbox>
                                </Button>

                                <c1:C1TreeView Grid.Row="1" x:Name="myTreeView" 
                                               Grid.ColumnSpan="2"
                       MouseLeftButtonUp="MyTreeView_MouseLeftButtonUp"
                       Loaded="MyTreeView_Loaded" Margin="0,0,26,0">
                                    <c1:C1TreeView.ItemContainerStyle>
                                        <Style TargetType="{x:Type c1:C1TreeViewItem}">
                                            <Setter Property="BorderThickness" Value="1.5"/>
                                            <Setter Property="Margin" Value="1"></Setter>
                                            <Setter Property="Cursor" Value="Hand"></Setter>
                                            <Style.Triggers>
                                                <Trigger Property="IsSelected" Value="True">
                                                    <Setter Property="BorderBrush" Value="Transparent"/>
                                                    <Setter Property="TreeViewItem.Background" Value="White"></Setter>

                                                </Trigger>
                                                <Trigger Property="IsSelected" Value="false">
                                                    <Setter Property="BorderBrush" Value="Transparent"/>
                                                    <Setter Property="Background" Value="WhiteSmoke"></Setter>
                                                </Trigger>
                                                <Trigger Property="IsMouseOver" Value="true">
                                                    <Setter Property="Background" Value="Azure"/>
                                                </Trigger>
                                            </Style.Triggers>
                                            <Style.Resources>
                                                <Style TargetType="Border">
                                                    <Setter Property="CornerRadius" Value="2"/>
                                                </Style>
                                            </Style.Resources>
                                        </Style>
                                    </c1:C1TreeView.ItemContainerStyle>
                                    <c1:C1TreeView.Resources>
                                        <DataTemplate DataType="{x:Type local:Categories}" >
                                            <Border VerticalAlignment="Top" Height="65" Width="260" BorderBrush="Transparent" BorderThickness="2" CornerRadius="4" Margin="0 2 0 2">

                                                <Grid  >
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="30"></ColumnDefinition>
                                                        <ColumnDefinition Width="*"></ColumnDefinition>
                                                        <ColumnDefinition Width="20"></ColumnDefinition>
                                                        <ColumnDefinition Width="5"></ColumnDefinition>
                                                    </Grid.ColumnDefinitions>
                                                    <Image  Grid.Column="0" Source="{Binding ImageUrl}" Margin="2"/>
                                                    <TextBlock Grid.Column="1" Text="{Binding Text}" TextWrapping="Wrap" VerticalAlignment="Center" Margin="10,2,2,2" FontFamily="Calibri" FontSize="15"/>
                                                    <Image Grid.Column="2" Source= "{Binding ExpenderImg}"  Margin="2" />
                                                </Grid>
                                            </Border>
                                        </DataTemplate>
                                        <DataTemplate DataType="{x:Type local:Reports}" x:Name="reportTemplate">
                                            <Border VerticalAlignment="Top" Height="120" Width="260" Padding="0" BorderThickness="2" CornerRadius="4" Background="White">
                                                <Grid  Background="Transparent" Margin="0" >
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="150"></ColumnDefinition>
                                                        <ColumnDefinition Width="*"></ColumnDefinition>
                                                    </Grid.ColumnDefinitions>
                                                    <Image Source="{Binding ImageUrl}" Grid.Column="0"  Margin="0" Stretch="Fill" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
                                                    <TextBlock Text="{Binding RptTitle}" TextWrapping="Wrap" VerticalAlignment="Center" Margin="2" Grid.Column="1" FontFamily="Calibri" FontSize="12"/>

                                                </Grid>
                                            </Border>
                                        </DataTemplate>
                                    </c1:C1TreeView.Resources>
                                </c1:C1TreeView>
                            </Grid>
                        </c1:C1DockTabItem>
                    </c1:C1DockTabControl>
                </c1:C1DockGroup>
            </c1:C1DockControl>
        </DockPanel>

        <c1:C1FlexViewer x:Name="flexViewer" Grid.Column="1" />

    </Grid>
</Window>
