<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: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"
  mc:Ignorable="d"
    RequestedTheme="Default" Height="130">

    <StackPanel Orientation="Vertical" Background="White">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="2*" />
                <ColumnDefinition Width="1*" />
                <ColumnDefinition Width="2*" />
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="FontFamily:" FontSize="12" FontWeight="Bold" Padding="15, 5" Foreground="{StaticResource Grey700}"/>
            <cc:MyComboBox Grid.Column="2" VerticalAlignment="Stretch" HorizontalContentAlignment="Right" Margin="1,0,0,0" Display="{Binding}" Width="120">
                <cc:MyComboBox.DisplayTemplate>
                    <DataTemplate>
                        <TextBlock TextTrimming="WordEllipsis">
                        <!--<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="SemiBold"  />
                </cc:MyComboBox.DropdownHeader>
                <cc:MyComboBox.Content>
                    <cc:NavList ItemsSource="{x:Bind SystemFontFamilies}" SelectedValue="{Binding FontFamily, Mode=TwoWay}" IsAutoCloseParentPopup="True">
                        <cc:NavList.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Mode=TwoWay}" FontFamily="{Binding Mode=TwoWay}"/>
                            </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}" />
        </Grid>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="2*" />
                <ColumnDefinition Width="1*" />
                <ColumnDefinition Width="2*" />
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="FontSize:" FontSize="12" FontWeight="Bold" Padding="15, 5" Foreground="{StaticResource Grey700}"/>
            <cc:MyComboBox Grid.Column="2" VerticalAlignment="Stretch" HorizontalContentAlignment="Right" Margin="1,0,0,0" Display="{Binding}" Width="120">
                <cc:MyComboBox.DisplayTemplate>
                    <DataTemplate>
                        <TextBlock HorizontalAlignment="Right">
                        <Run Text="{Binding FontSize}" />
                        </TextBlock>
                    </DataTemplate>
                </cc:MyComboBox.DisplayTemplate>
                <cc:MyComboBox.DropdownHeader>
                    <TextBlock Margin="10,0" VerticalAlignment="Stretch" Text="FONT SIZE" Foreground="{StaticResource Blue500}" FontSize="12" FontWeight="Normal"  />
                </cc:MyComboBox.DropdownHeader>
                <cc:MyComboBox.Content>
                    <cc:NavList x:Name="fontNavList" SelectedValuePath="Value" SelectedValue="{Binding FontSize, Mode=TwoWay}"
                            IsAutoCloseParentPopup="True" ItemsSource="{x:Bind DictionaryEntries}">
                        <cc:NavList.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Key}" />
                            </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}"/>
        </Grid>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="2*" />
                <ColumnDefinition Width="1*" />
                <ColumnDefinition Width="2*" />
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="Foreground:" FontSize="12" FontWeight="Bold" Padding="15, 5" Foreground="{StaticResource Grey700}"/>
            <cc:MyComboBox CustomHorizontalOffset="-12" CustomVertialOffset="15" Grid.Column="2" VerticalAlignment="Stretch" HorizontalContentAlignment="Right" Margin="1,0,0,0" Display="{Binding}" Grid.ColumnSpan="2" Width="120">
                <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="Normal" />
                            <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="Normal"  />
                </cc:MyComboBox.DropdownHeader>
                <cc:MyComboBox.Content>
                    <Viewbox Stretch="UniformToFill" MaxHeight="290" MaxWidth="320">
                        <cc:MyBasicColorPickerPart FontSize="16" Background="White" Margin="15,0" Foreground="{StaticResource Grey700}" SelectedColor="{Binding Foreground, Mode=TwoWay}" />
                    </Viewbox>
                </cc:MyComboBox.Content>
            </cc:MyComboBox>
        </Grid>
    </StackPanel>
</UserControl>
