<UserControl x:Class="StockAnalysis.Partial.UserControls.AnnotationTextSettings"
             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:coll="clr-namespace:System.Collections;assembly=mscorlib"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:cc="clr-namespace:StockAnalysis.Partial.CustomControls"
             xmlns:c1ext="clr-namespace:C1.WPF.Extended;assembly=C1.WPF.Extended.4"
             xmlns:local="clr-namespace:StockAnalysis.Partial.UserControls"
             mc:Ignorable="d" Background="White"
              d:DesignHeight="480" d:DesignWidth="300" MouseDoubleClick="UserControl_MouseDoubleClick">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/StockAnalysis;component/Resources/ResourceDictionary.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <StackPanel Orientation="Vertical">

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="FontFamily:" FontWeight="Bold" Padding="0, 5" Margin="0, 0, 10, 0" SnapsToDevicePixels="True" />
            <cc:MyComboBox Grid.Column="2" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" Margin="1,0,0,0" Display="{Binding}">
                <cc:MyComboBox.DisplayTemplate>
                    <DataTemplate>
                        <TextBlock>
                        <!--<Run Text="Font:" />-->
                        <Run Text="{Binding FontFamily}" FontFamily="{Binding FontFamily}" />
                        </TextBlock>
                    </DataTemplate>
                </cc:MyComboBox.DisplayTemplate>
                <cc:MyComboBox.DropdownHeader>
                    <TextBlock Margin="10,0" Text="FONT FAMILY" Foreground="{StaticResource Blue500}" FontSize="12" FontWeight="DemiBold"  />
                </cc:MyComboBox.DropdownHeader>
                <cc:MyComboBox.Content>
                    <cc:NavList ItemsSource="{Binding Source={x:Static Fonts.SystemFontFamilies}}"
                            SelectedValue="{Binding FontFamily, Mode=TwoWay}"
                             IsAutoCloseParentPopup="True" >
                        <cc:NavList.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding}" FontFamily="{Binding}" />
                            </DataTemplate>
                        </cc:NavList.ItemTemplate>
                    </cc:NavList>
                </cc:MyComboBox.Content>
            </cc:MyComboBox>
            <Rectangle Grid.Row="1" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Height="1" Margin="0, 10" Fill="{StaticResource PaperWhite700}" SnapsToDevicePixels="True" />
        </Grid>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="FontSize:" FontWeight="Bold" Padding="0, 5" Margin="0, 0, 10, 0" SnapsToDevicePixels="True" />
            <cc:MyComboBox Grid.Column="2" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" Margin="1,0,0,0" Display="{Binding}">
                <cc:MyComboBox.DisplayTemplate>
                    <DataTemplate>
                        <TextBlock HorizontalAlignment="Right">
                        <Run Text="{Binding FontSize}" />
                        </TextBlock>
                    </DataTemplate>
                </cc:MyComboBox.DisplayTemplate>
                <cc:MyComboBox.DropdownHeader>
                    <TextBlock Margin="10,0" Text="FONT SIZE" Foreground="{StaticResource Blue500}" FontSize="12" FontWeight="DemiBold"  />
                </cc:MyComboBox.DropdownHeader>
                <cc:MyComboBox.Content>
                    <cc:NavList SelectedValuePath="Value" SelectedValue="{Binding FontSize, Mode=TwoWay}"
                            IsAutoCloseParentPopup="True">
                        <cc:NavList.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Key}" />
                            </DataTemplate>
                        </cc:NavList.ItemTemplate>
                        <cc:NavList.ItemsSource>
                            <coll:ArrayList>
                                <coll:DictionaryEntry Key="8pt" Value="8"/>
                                <coll:DictionaryEntry Key="9pt" Value="9"/>
                                <coll:DictionaryEntry Key="10pt" Value="10"/>
                                <coll:DictionaryEntry Key="12pt" Value="12"/>
                                <coll:DictionaryEntry Key="14pt" Value="14"/>
                                <coll:DictionaryEntry Key="18pt" Value="18"/>
                                <coll:DictionaryEntry Key="24pt" Value="24"/>
                                <coll:DictionaryEntry Key="32pt" Value="32"/>
                                <coll:DictionaryEntry Key="48pt" Value="48"/>
                                <coll:DictionaryEntry Key="64pt" Value="64"/>
                            </coll:ArrayList>
                        </cc:NavList.ItemsSource>
                    </cc:NavList>
                </cc:MyComboBox.Content>
            </cc:MyComboBox>
            <Rectangle Grid.Row="1" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Height="1" Margin="0, 10" Fill="{StaticResource PaperWhite700}" SnapsToDevicePixels="True" />
        </Grid>


        <Grid Visibility="Collapsed">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="FontWeight:" FontWeight="Bold" Padding="0, 5" Margin="0, 0, 10, 0" SnapsToDevicePixels="True" />
            <cc:MyComboBox Grid.Column="2" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" Margin="1,0,0,0" Display="{Binding}">
                <cc:MyComboBox.DisplayTemplate>
                    <DataTemplate>
                        <TextBlock>
                        <!--<Run Text="Weight:" />-->
                        <Run Text="{Binding FontWeight}" />
                        </TextBlock>
                    </DataTemplate>
                </cc:MyComboBox.DisplayTemplate>
                <cc:MyComboBox.DropdownHeader>
                    <TextBlock Margin="10,0" Text="FONT WEIGHT" Foreground="{StaticResource Blue500}" FontSize="12" FontWeight="DemiBold"  />
                </cc:MyComboBox.DropdownHeader>
                <cc:MyComboBox.Content>
                    <cc:NavList ItemsSource="{Binding FontWeights}" SelectedValue="{Binding FontWeight, Mode=TwoWay}"
                             IsAutoCloseParentPopup="True"/>
                </cc:MyComboBox.Content>
            </cc:MyComboBox>
            <Rectangle Grid.Row="1" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Height="1" Margin="0, 10" Fill="{StaticResource PaperWhite700}" SnapsToDevicePixels="True" />
        </Grid>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="Foreground:" FontWeight="Bold" Padding="0, 5" Margin="0, 0, 10, 0" SnapsToDevicePixels="True" />
            <cc:MyComboBox Grid.Column="2" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" Margin="1,0,0,0" Display="{Binding}" Grid.ColumnSpan="2">
                <cc:MyComboBox.DisplayTemplate>
                    <DataTemplate>
                        <Grid Margin="0 2">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <TextBlock Text="A" HorizontalAlignment="Center" Foreground="Black" FontWeight="DemiBold" />
                            <Rectangle Grid.Row="1" Width="18" HorizontalAlignment="Stretch" Height="5" Fill="{Binding Foreground, Converter={StaticResource Color2BrushConverter}}" />
                        </Grid>
                    </DataTemplate>
                </cc:MyComboBox.DisplayTemplate>
                <cc:MyComboBox.DropdownHeader>
                    <TextBlock Margin="10,0" Text="FOREGROUND" Foreground="{StaticResource Blue500}" FontSize="12" FontWeight="DemiBold"  />
                </cc:MyComboBox.DropdownHeader>
                <cc:MyComboBox.Content>
                    <cc:MyBasicColorPickerPart Background="White" Margin="15,0" Foreground="{StaticResource Grey700}" SelectedColor="{Binding Foreground, Mode=TwoWay}" />
                </cc:MyComboBox.Content>
            </cc:MyComboBox>
            <Rectangle Grid.Row="1" Grid.ColumnSpan="4" HorizontalAlignment="Stretch" Height="1" Margin="0, 10" Fill="{StaticResource PaperWhite700}" SnapsToDevicePixels="True" />
        </Grid>
    </StackPanel>
</UserControl>
