<UserControl
    x:Class="StockAnalysis.Partial.UserControls.AnnotationSettings"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:StockAnalysis.Partial.UserControls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:cc="using:StockAnalysis.Partial.CustomControls"
  xmlns:uc="using:StockAnalysis.Partial.UserControls"
  mc:Ignorable="d"
    d:DesignHeight="29" d:DesignWidth="430" DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}">

    <Grid Background="{StaticResource PaperWhite1000}" BorderBrush="{StaticResource Grey300}" BorderThickness="1, 0, 0, 0">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="1" Grid.Column="1" Background="{StaticResource PaperWhite1000}" HorizontalAlignment="Left" Orientation="Horizontal">
            <Border BorderThickness="0,0,1,0" BorderBrush="{StaticResource Grey300}">
                <cc:DropdownControl CustomHorizontalOffset="-8" CustomVertialOffset="-9" x:Name="dropdownControl" VerticalAlignment="Stretch" MinWidth="210"
                                 Display="{Binding Model}">
                    <cc:DropdownControl.DisplayTemplate>
                        <DataTemplate>
                            <TextBlock>
                        <Run Text="Annotation type:" />
                        <Run Text="{Binding NewAnnotationType}" />
                            </TextBlock>
                        </DataTemplate>
                    </cc:DropdownControl.DisplayTemplate>
                    <cc:DropdownControl.DropdownHeader>
                        <TextBlock Margin="10,0" Text="ANNOTATION TYPE" Foreground="{StaticResource Blue500}" FontSize="12" FontWeight="Normal"  />
                    </cc:DropdownControl.DropdownHeader>
                    <cc:DropdownControl.Content>
                        <local:Annotations />
                    </cc:DropdownControl.Content>
                </cc:DropdownControl>
            </Border>

            <Border x:Name="strokeComboBorder" Visibility="Collapsed" BorderThickness="0,0,1,0" BorderBrush="{StaticResource Grey300}">
                <cc:MyComboBox CustomHorizontalOffset="-12" CustomVertialOffset="15" x:Name="strokeComboBox" Visibility="Collapsed" Grid.Column="2" VerticalAlignment="Stretch" HorizontalContentAlignment="Right" Margin="0,0,0,0" Display="{Binding Model}" Width="64">
                    <cc:MyComboBox.DisplayTemplate>
                        <DataTemplate>
                            <Rectangle Width="18" Height="14" Stroke="{Binding AnnotationStyle.Stroke, Converter={StaticResource Color2BrushConverter}}" StrokeThickness="2" />
                        </DataTemplate>
                    </cc:MyComboBox.DisplayTemplate>
                    <cc:MyComboBox.DropdownHeader>
                        <TextBlock Margin="10,0" Text="ANNOTATION STROKE COLOR" Foreground="{StaticResource Blue500}" FontSize="12" FontWeight="Normal"  />
                    </cc:MyComboBox.DropdownHeader>
                    <cc:MyComboBox.Content>
                        <Viewbox Stretch="UniformToFill" MaxHeight="320" MaxWidth="358">
                            <cc:MyBasicColorPickerPart FontSize="16" Background="White" Margin="15,0" Foreground="{StaticResource Grey700}" SelectedColor="{Binding Model.AnnotationStyle.Stroke, Mode=TwoWay}" />
                        </Viewbox>
                    </cc:MyComboBox.Content>
                </cc:MyComboBox>
            </Border>

            <Border x:Name="fillComboBorder" Visibility="Collapsed" BorderThickness="0,0,1,0" BorderBrush="{StaticResource Grey300}">
                <cc:MyComboBox CustomHorizontalOffset="-12" CustomVertialOffset="15" x:Name="fillComboBox" Visibility="Collapsed"  Grid.Column="2" VerticalAlignment="Stretch" HorizontalContentAlignment="Right" Display="{Binding Model}" Width="63">
                    <cc:MyComboBox.DisplayTemplate>
                        <DataTemplate>
                            <Border>
                                <Border.Background>
                                    <ImageBrush ImageSource="/Resources/TransparentBase.png" />
                                </Border.Background>
                                <Rectangle Width="18" Height="14" Fill="{Binding AnnotationStyle.Fill, Mode=TwoWay, Converter={StaticResource Color2BrushConverter}}" />
                            </Border>
                        </DataTemplate>
                    </cc:MyComboBox.DisplayTemplate>
                    <cc:MyComboBox.DropdownHeader>
                        <TextBlock Margin="10,0" Text="ANNOTATION FILL COLOR" Foreground="{StaticResource Blue500}" FontSize="12" FontWeight="Normal"  />
                    </cc:MyComboBox.DropdownHeader>
                    <cc:MyComboBox.Content>
                        <Viewbox Stretch="UniformToFill" MaxHeight="320" MaxWidth="358">
                            <cc:MyBasicColorPickerPart FontSize="16" Background="White" Margin="15,0" Foreground="{StaticResource Grey700}" SelectedColor="{Binding Model.AnnotationStyle.Fill, Mode=TwoWay}" />
                        </Viewbox>
                    </cc:MyComboBox.Content>
                </cc:MyComboBox>
            </Border>

            <cc:DropdownControl CustomHorizontalOffset="-11" CustomVertialOffset="-9" x:Name="fontDropdownControl" Visibility="Collapsed" VerticalAlignment="Stretch"
                                 Display="{Binding Model.AnnotationStyle}" MinWidth="112">
                <cc:DropdownControl.DisplayTemplate>
                    <DataTemplate>
                        <TextBlock>
                        <Run Text="Font:" />
                        <Run Text="{Binding FontFamily}" />
                        </TextBlock>
                    </DataTemplate>
                </cc:DropdownControl.DisplayTemplate>
                <cc:DropdownControl.DropdownHeader>
                    <TextBlock Margin="10,0" Text="FONT STYLE" Foreground="{StaticResource Blue500}" FontSize="12" FontWeight="Normal"  />
                </cc:DropdownControl.DropdownHeader>
                <cc:DropdownControl.Content>
                    <uc:AnnotationTextSettings x:Name="annotationTextSettings" />
                </cc:DropdownControl.Content>
            </cc:DropdownControl>

            <Border Grid.Column="2" Background="White" Margin="1,0,0,0" />
        </StackPanel>
    </Grid>
</UserControl>
