<UserControl x:Class="PDFTron.SilverDox.Samples.Controls.AnnotationToolModePickerControl"
    x:Name="annotationToolsPicker"
    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"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400"
    Loaded="annotationToolsPicker_Loaded">

    <UserControl.Resources>
        <ResourceDictionary Source="/ReaderControl;component/Resources/ResourceDictionary.xaml"/>
    </UserControl.Resources>
    
    <Grid x:Name="LayoutRoot" Background="White">

        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <!-- Misc. Annotation Tools -->
        <Border BorderBrush="Black" BorderThickness="0" Grid.Row="1">
            <ListBox HorizontalAlignment="Stretch" 
                  HorizontalContentAlignment="Stretch"
                  x:Name="annotationsListBox"
                  Style="{StaticResource HorizontalWrapListBox}"
                  ScrollViewer.HorizontalScrollBarVisibility="Hidden" 
                  ScrollViewer.VerticalScrollBarVisibility="Hidden" 
                  SelectedValuePath="Tag" 
                  SelectedValue="{Binding Path=ToolMode, Mode=TwoWay, Converter={StaticResource ModeConverter}, ConverterParameter=annotatetool}" >

                <ListBox.ItemContainerStyle>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="HorizontalAlignment" Value="Stretch"/>
                        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    </Style>
                </ListBox.ItemContainerStyle>

                <ListBoxItem Tag="AnnotationEdit" Visibility="Visible">
                    <Image Source="/ReaderControl;component/Resources/annotation_tool_icons/annot_edit.png" Stretch="None"/>
                    <ToolTipService.ToolTip>
                        <ToolTip Placement="Bottom">
                            <TextBlock Text="{Binding Source={StaticResource StringResource}, Path=AnnotationEditToolTip }"/>
                        </ToolTip>
                    </ToolTipService.ToolTip>
                </ListBoxItem>

                <ListBoxItem Tag="AnnotationCreateSticky" Visibility="Visible">
                    <Image Source="/ReaderControl;component/Resources/annotation_tool_icons/annot_sticky_note.png" Stretch="None"/>
                    <ToolTipService.ToolTip>
                        <ToolTip Placement="Bottom">
                            <TextBlock Text="{Binding Source={StaticResource StringResource}, Path=AnnotationCreateStickyToolTip }"/>
                        </ToolTip>
                    </ToolTipService.ToolTip>
                </ListBoxItem>

                <ListBoxItem Tag="AnnotationCreateTextHighlight" Visibility="Visible">
                    <Image Source="/ReaderControl;component/Resources/annotation_tool_icons/annot_highlight.png" Stretch="None"/>
                    <ToolTipService.ToolTip>
                        <ToolTip Placement="Bottom">
                            <TextBlock Text="{Binding Source={StaticResource StringResource}, Path=AnnotationCreateTextHighlightToolTip }"/>
                        </ToolTip>
                    </ToolTipService.ToolTip>
                </ListBoxItem>

                <ListBoxItem Tag="AnnotationCreateTextUnderline" Visibility="Visible">
                    <Image Source="/ReaderControl;component/Resources/annotation_tool_icons/annot_underline.png" Stretch="None"/>
                    <ToolTipService.ToolTip>
                        <ToolTip Placement="Bottom">
                            <TextBlock Text="{Binding Source={StaticResource StringResource}, Path=AnnotationCreateTextUnderlineToolTip }"/>
                        </ToolTip>
                    </ToolTipService.ToolTip>
                </ListBoxItem>
                
                <ListBoxItem Tag="AnnotationCreateTextStrikeout" Visibility="Visible">
                    <Image Source="/ReaderControl;component/Resources/annotation_tool_icons/annot_strikethrough.png" Stretch="None"/>
                    <ToolTipService.ToolTip>
                        <ToolTip Placement="Bottom">
                            <TextBlock Text="{Binding Source={StaticResource StringResource}, Path=AnnotationCreateTextStrikeoutToolTip }"/>
                        </ToolTip>
                    </ToolTipService.ToolTip>
                </ListBoxItem>

                <!-- Must be here so binding doesn't screw up on selected item / tag -->
                <ListBoxItem Tag="Pan" Visibility="Collapsed"/>
                <ListBoxItem Tag="TextSelect" Visibility="Collapsed"/>
                <ListBoxItem Tag="AnnotationCreateRectangle" Visibility="Collapsed"/>
                <ListBoxItem Tag="AnnotationCreateEllipse" Visibility="Collapsed"/>
                <ListBoxItem Tag="AnnotationCreateLine" Visibility="Collapsed"/>
                <ListBoxItem Tag="AnnotationCreateFreeHand" Visibility="Collapsed"/>
            </ListBox>
        </Border>

        <!-- Shape Annotation Tools -->
        <Border BorderBrush="Black" BorderThickness="0" Grid.Row="3">
            <ListBox HorizontalAlignment="Stretch" 
                  x:Name="shapesListBox"
                  Style="{StaticResource HorizontalWrapListBox}"
                  ScrollViewer.HorizontalScrollBarVisibility="Hidden" 
                  ScrollViewer.VerticalScrollBarVisibility="Hidden" 
                  SelectedValuePath="Tag" 
                  SelectedValue="{Binding Path=ToolMode, Mode=TwoWay, Converter={StaticResource ModeConverter}, ConverterParameter=annotatetool}" >
    
                <ListBox.ItemContainerStyle>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="HorizontalAlignment" Value="Stretch"/>
                        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    </Style>
                </ListBox.ItemContainerStyle>
    
                <ListBoxItem Tag="AnnotationCreateRectangle">
                    <Image Source="/ReaderControl;component/Resources/annotation_tool_icons/annot_rectangle.png" Stretch="None"/>
                    <ToolTipService.ToolTip>
                        <ToolTip Placement="Bottom">
                            <TextBlock Text="{Binding Source={StaticResource StringResource}, Path=AnnotationCreateRectangleToolTip }"/>
                        </ToolTip>
                    </ToolTipService.ToolTip>
                </ListBoxItem>

                <ListBoxItem Tag="AnnotationCreateEllipse">
                    <Image Source="/ReaderControl;component/Resources/annotation_tool_icons/annot_ellipse.png" Stretch="None"/>
                    <ToolTipService.ToolTip>
                        <ToolTip Placement="Bottom">
                            <TextBlock Text="{Binding Source={StaticResource StringResource}, Path=AnnotationCreateEllipseToolTip }"/>
                        </ToolTip>
                    </ToolTipService.ToolTip>
                </ListBoxItem>

                <ListBoxItem Tag="AnnotationCreateLine" HorizontalContentAlignment="Center">
                    <Image Source="/ReaderControl;component/Resources/annotation_tool_icons/annot_line.png" Stretch="None"/>
                    <ToolTipService.ToolTip>
                        <ToolTip Placement="Bottom">
                            <TextBlock Text="{Binding Source={StaticResource StringResource}, Path=AnnotationCreateLineToolTip }"/>
                        </ToolTip>
                    </ToolTipService.ToolTip>
                </ListBoxItem>

                <ListBoxItem Tag="AnnotationCreateFreeHand">
                    <Image Source="/ReaderControl;component/Resources/annotation_tool_icons/annot_paintbrush.png" Stretch="None"/>
                    <ToolTipService.ToolTip>
                        <ToolTip Placement="Bottom">
                            <TextBlock Text="{Binding Source={StaticResource StringResource}, Path=AnnotationCreateFreeHandToolTip }"/>
                        </ToolTip>
                    </ToolTipService.ToolTip>
                </ListBoxItem>
    
                <!-- Must be here so binding doesn't screw up on selected item / tag -->
                <ListBoxItem Tag="AnnotationEdit" Visibility="Collapsed"/>
                <ListBoxItem Tag="AnnotationCreateSticky" Visibility="Collapsed"/>
                <ListBoxItem Tag="AnnotationCreateTextHighlight" Visibility="Collapsed"/>
                <ListBoxItem Tag="AnnotationCreateTextUnderline" Visibility="Collapsed"/>
                <ListBoxItem Tag="AnnotationCreateTextStrikeout" Visibility="Collapsed"/>
                <ListBoxItem Visibility="Collapsed" Tag="Pan"/>
                <ListBoxItem Visibility="Collapsed" Tag="TextSelect"/>
            </ListBox>

        </Border>
    </Grid>
</UserControl>
