<UserControl x:Class="FFXIV_TexTools.Views.Controls.ItemSelectControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:FFXIV_TexTools.Views.Controls"
             xmlns:resx="clr-namespace:FFXIV_TexTools.Resources"
             resx:Localization.Enabled="True"             
             mc:Ignorable="d" Height="449.791" Width="568.146">
    <Grid x:Name="GridPanel">
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" MinHeight="45"/>
            <RowDefinition/>
            <RowDefinition Height="36"/>
        </Grid.RowDefinitions>

        <TabControl x:Name="Tabs" Grid.Row="1" Margin="0" Background="{x:Null}">
            <TabItem Header="By Category">
                <TreeView x:Name="CategoryTree" Background="{x:Null}" ItemsSource="{Binding CategoryElements,Mode=TwoWay}"  Style="{StaticResource VirtualisedMetroTreeView}">
                    <TreeView.ItemContainerStyle>
                        <Style BasedOn="{StaticResource MetroTreeViewItem}" TargetType="{x:Type TreeViewItem}">
                            <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
                            <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
                        </Style>
                    </TreeView.ItemContainerStyle>
                    <TreeView.Resources>
                        <HierarchicalDataTemplate ItemsSource="{Binding Children}" DataType="{x:Type local:ItemTreeElement}">
                            <StackPanel>
                                <TextBlock Text="{Binding DisplayName}"/>
                            </StackPanel>
                        </HierarchicalDataTemplate>
                    </TreeView.Resources>
                </TreeView>
            </TabItem>
            <TabItem Header="By Set">
                <TreeView x:Name="SetTree" Background="{x:Null}" ItemsSource="{Binding SetElements,Mode=TwoWay}"  Style="{StaticResource VirtualisedMetroTreeView}">
                    <TreeView.ItemContainerStyle>
                        <Style BasedOn="{StaticResource MetroTreeViewItem}" TargetType="{x:Type TreeViewItem}">
                            <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
                            <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
                        </Style>
                    </TreeView.ItemContainerStyle>
                    <TreeView.Resources>
                        <HierarchicalDataTemplate ItemsSource="{Binding Children}" DataType="{x:Type local:ItemTreeElement}">
                            <StackPanel>
                                <TextBlock Text="{Binding DisplayName}"/>
                            </StackPanel>
                        </HierarchicalDataTemplate>
                    </TreeView.Resources>
                </TreeView>
            </TabItem>
        </TabControl>

        <TextBox x:Name="SearchBar" Margin="5,5,5,0" TextWrapping="Wrap" VerticalAlignment="Top"  Controls:TextBoxHelper.Watermark="{Binding Source={x:Static resx:UIStrings.Search_dot}}" />
        <Button x:Name="SelectButton" Content="Select Item" Margin="50,5" Grid.Row="2" Height="26" HorizontalAlignment="Center" Width="200"/>

    </Grid>
</UserControl>
