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

    <Grid>
        <Grid.Resources>
            <Style TargetType="Image" x:Key="TreeIcon">
                <Setter Property="Width" Value="22" />
                <Setter Property="Height" Value="22" />
                <Setter Property="Margin" Value="8 0" />
            </Style>
            <Style TargetType="TextBlock" x:Key="TreeText">
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <StackPanel Orientation="Horizontal" Height="50" Margin="0 0 10 0">
            <TextBlock Text="TabItemClose:" VerticalAlignment="Center" FontSize="16" Width="110" />
            <ComboBox x:Name="cmbTabItemClose" Height="30" VerticalAlignment="Center"  Width="130" SelectionChanged="cmbTabItemClose_SelectionChanged">
                <ComboBoxItem>None</ComboBoxItem>
                <ComboBoxItem IsSelected="True">InEachTab</ComboBoxItem>
                <ComboBoxItem>GlobalClose</ComboBoxItem>
            </ComboBox>
        </StackPanel>
        <StackPanel x:Name="tabStripOverlapPanel" Orientation="Horizontal" Height="50" Grid.Column="1" Margin="0 0 10 0">
            <TextBlock Text="TabStripOverlap:" VerticalAlignment="Center" FontSize="16" Width="140" />
            <Slider Width="120" Height="50" Maximum="10" VerticalAlignment="Center" Minimum="0" Value="{Binding ElementName=tabControl, Path=TabStripOverlap, Mode=TwoWay}" />
        </StackPanel>

        <c1:C1TabControl x:Name="tabControl" 
                         Grid.Row="2" 
                         Grid.ColumnSpan="3" 
                         TabItemShape="Sloped"
                         TabStripOverlapDirection="Left"  
                         TabStripOverlap="8" 
                         TabItemClose="InEachTab" 
                         TabStripMenuVisibility="Visible"
                         d:IsHidden="True">
            <c1:C1TabItem CanUserPin="True">
                <c1:C1TabItem.Header>
                    <TextBlock x:Name="perMonthTb" Text="Sales Per Month" />
                </c1:C1TabItem.Header>
                <local:SalesPerMonth />
            </c1:C1TabItem>
            <c1:C1TabItem CanUserPin="True">
                <c1:C1TabItem.Header>
                    <TextBlock x:Name="perSalesAgentTb" Text="Sales Per Sales Agent" />
                </c1:C1TabItem.Header>
                <local:SalesPerAgents/>
            </c1:C1TabItem>
            <c1:C1TabItem CanUserPin="True">
                <c1:C1TabItem.Header>
                    <TextBlock x:Name="salesAgentsTb" Text="Sales Agents" />
                </c1:C1TabItem.Header>
                <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" BorderThickness="0" Background="Transparent" Margin="0" Padding="0">
                    <local:SalesAgents />
                </ScrollViewer>
            </c1:C1TabItem>
            <c1:C1TabItem CanUserPin="True">
                <c1:C1TabItem.Header>
                    <TextBlock x:Name="reportSummaryTb" Text="Report Summary" />
                </c1:C1TabItem.Header>
                <local:ReportSummary/>
            </c1:C1TabItem>
            <c1:C1TabItem CanUserPin="True">
                <c1:C1TabItem.Header>
                    <TextBlock x:Name="tab5Tb" Text="Tab 5"/>
                </c1:C1TabItem.Header>
                <ScrollViewer VerticalScrollBarVisibility="Auto" BorderThickness="0" Background="Transparent" Margin="0" Padding="0">
                    <TextBlock TextWrapping="Wrap" FontSize="14" Margin="10 0">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur</TextBlock>
                </ScrollViewer>
            </c1:C1TabItem>
            <c1:C1TabItem CanUserPin="True">
                <c1:C1TabItem.Header>
                    <TextBlock x:Name="tab6Tb" Text="Tab 6"/>
                </c1:C1TabItem.Header>
                <ScrollViewer VerticalScrollBarVisibility="Auto" BorderThickness="0" Background="Transparent" Margin="0" Padding="0">
                    <TextBlock TextWrapping="Wrap" FontSize="14" Margin="10 0">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur</TextBlock>
                </ScrollViewer>
            </c1:C1TabItem>
        </c1:C1TabControl>
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="WideLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="540"/>
                    </VisualState.StateTriggers>
                </VisualState>
                <VisualState x:Name="NarrowLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="0"/>
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="tabStripOverlapPanel.(Grid.Row)" Value="1"></Setter>
                        <Setter Target="tabStripOverlapPanel.(Grid.Column)" Value="0"></Setter>
                        <Setter Target="perMonthTb.FontSize" Value="10"></Setter>
                        <Setter Target="perSalesAgentTb.FontSize" Value="10"></Setter>
                        <Setter Target="salesAgentsTb.FontSize" Value="10"></Setter>
                        <Setter Target="reportSummaryTb.FontSize" Value="10"></Setter>
                        <Setter Target="tab5Tb.FontSize" Value="10"></Setter>
                        <Setter Target="tab6Tb.FontSize" Value="10"></Setter>
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</Page>