<UserControl
    x:Class="StockAnalysis.Partial.UserControls.Overlays"
    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:data="using:StockAnalysis.Data"
  mc:Ignorable="d"
    d:DesignHeight="400" MinWidth="250" DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}">
    <StackPanel Background="{StaticResource PaperWhite1000}">
        <cc:NavList x:Name="listbox" BorderThickness="0" SelectionChanged="listbox_SelectionChanged" >
            <cc:NavList.ItemContainerStyle>
                <Style TargetType="ListBoxItem">
                    <Setter Property="Background" Value="White"/>
                    <Setter Property="BorderBrush" Value="{StaticResource PaperWhite800}"/>
                    <Setter Property="BorderThickness" Value="1"/>
                    <Setter Property="VerticalAlignment" Value="Stretch" />
                    <Setter Property="VerticalContentAlignment" Value="Center" />
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    <Setter Property="Padding" Value="15,3"/>
                    <Setter Property="UseSystemFocusVisuals" Value="True"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="ListBoxItem">
                                <Border x:Name="templateRoot">
                                    <Grid Margin="{TemplateBinding Padding}" MinHeight="24">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <ContentPresenter FontWeight="Normal" FontSize="12" x:Name="contentPresenter" Margin="0,0,10,0" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Foreground="{Binding IsSelected, RelativeSource={RelativeSource Mode=TemplatedParent}, Converter={StaticResource SelectedListBoxItem2ColorConverter}}"/>
                                        <Button x:Name="setting" Grid.Column="1" Margin="10, 0" Background="Transparent" BorderBrush="Transparent"
                                     Visibility="{Binding IsSelected, RelativeSource={RelativeSource Mode=TemplatedParent}, Converter={StaticResource Boolean2VisibilityConverter}}"
                                         Padding="4"
                                         HorizontalAlignment="Center" VerticalAlignment="Center"
                                         Command="{StaticResource SettingCommand}" CommandParameter="{Binding Tag}">
                                            <Path Visibility="Visible" Data="M12,7.6c0,0.1,0,0.2,0,0.4c0,0.1-0.1,0.3-0.1,0.4c-0.1,0.2-0.1,0.3-0.2,0.4c-0.1,0.1-0.2,0.2-0.3,0.3
	c-0.1,0.1-0.2,0.1-0.3,0.1c-0.1,0-0.2,0-0.3-0.1c-0.1,0-0.2,0-0.3-0.1c-0.1,0-0.3,0-0.4,0c-0.1,0-0.3,0-0.4,0.1
	c-0.1,0-0.2,0.1-0.3,0.2C9.1,9.6,9,9.8,9,10.1c0,0.3,0,0.5,0.1,0.8c0.1,0.2,0.1,0.3,0,0.5c-0.1,0.1-0.1,0.1-0.2,0.2
	c-0.1,0.1-0.2,0.1-0.4,0.2c-0.1,0.1-0.3,0.1-0.4,0.1C7.9,12,7.8,12,7.6,12c-0.1,0-0.2,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2h0
	C7.2,11.5,7,11.2,6.8,11c-0.2-0.2-0.5-0.3-0.8-0.3c-0.3,0-0.6,0.1-0.8,0.3c-0.2,0.2-0.4,0.4-0.5,0.7c0,0.1-0.1,0.2-0.2,0.2
	C4.4,12,4.3,12,4.2,12c-0.1,0-0.3,0-0.4-0.1c-0.2,0-0.3-0.1-0.5-0.2c-0.2-0.1-0.3-0.1-0.4-0.2c-0.1-0.1-0.2-0.2-0.3-0.3
	c0-0.1-0.1-0.1-0.1-0.2c0-0.1,0-0.2,0.1-0.3c0.1-0.2,0.1-0.4,0.1-0.7c0-0.3-0.1-0.5-0.3-0.7C2.4,9.2,2.2,9.1,2.1,9.1
	c-0.2,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.8,9.8,3,10.1,3c0.3,0,0.6,0,0.8-0.1c0.1,0,0.2-0.1,0.3-0.1
	c0.1,0,0.2,0,0.3,0.1c0.1,0.1,0.2,0.3,0.3,0.5C11.9,3.7,12,3.9,12,4.2c0,0.1,0,0.3-0.1,0.3c-0.1,0.1-0.1,0.1-0.2,0.2
	C11.5,4.8,11.2,5,11,5.2c-0.2,0.2-0.3,0.5-0.3,0.8c0,0.3,0.1,0.5,0.2,0.8c0.2,0.2,0.4,0.4,0.6,0.5c0.1,0,0.1,0.1,0.2,0.1
	C11.9,7.4,11.9,7.5,12,7.6L12,7.6z M6,8.8c0.4,0,0.8-0.1,1.1-0.2C7.4,8.4,7.7,8.2,8,8c0.3-0.3,0.5-0.6,0.6-0.9
	C8.7,6.7,8.8,6.4,8.8,6S8.7,5.2,8.6,4.9C8.4,4.6,8.2,4.3,8,4C7.7,3.7,7.4,3.5,7.1,3.4C6.7,3.3,6.4,3.2,6,3.2c-0.4,0-0.7,0.1-1.1,0.2
	C4.6,3.5,4.3,3.7,4,4C3.8,4.3,3.6,4.6,3.4,4.9C3.3,5.2,3.2,5.6,3.2,6c0,0.4,0.1,0.7,0.2,1.1C3.6,7.4,3.8,7.7,4,8
	c0.3,0.3,0.5,0.5,0.9,0.6C5.2,8.7,5.6,8.8,6,8.8L6,8.8z M6,8.8" Fill="{StaticResource Grey700}" />
                                        </Button>
                                        <Border x:Name="radioButtonBorder" Grid.Column="2" Margin="10,0,0,0" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="100" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                            <Ellipse x:Name="optionMark" Margin="3" Fill="#398dff" MinWidth="6" MinHeight="6" Opacity="{Binding IsSelected, RelativeSource={RelativeSource Mode=TemplatedParent}, Converter={StaticResource OpacitySelectedConverter}}" />
                                        </Border>
                                    </Grid>
                                </Border>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </cc:NavList.ItemContainerStyle>
            <cc:NavList.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Name}" />
                </DataTemplate>
            </cc:NavList.ItemTemplate>
            <data:OverlayItem Name="IchimokuCloud" Tag="IchimokuCloud" Type="IchimokuCloud" />
            <data:OverlayItem Name="Bollinger Bands" Tag="Bollinger Bands" Type="BollingerBands" />
            <data:OverlayItem Name="Envelopes" Tag="Envelopes" Type="Envelopes" />
            <data:OverlayItem Name="Fibonacci Retracements" Tag="Fibonacci Retracements" Type="FibonacciRetracements" />
            <data:OverlayItem Name="Fibonacci Arcs" Tag="Fibonacci Arcs" Type="FibonacciArcs"/>
            <data:OverlayItem Name="Fibonacci Fans" Tag="Fibonacci Fans" Type="FibonacciFans"/>
            <data:OverlayItem Name="Fibonacci Time Zones" Tag="Fibonacci Time Zones" Type="FibonacciTimeZones" />
            <data:OverlayItem Name="Pivot Points" Tag="Pivot Points" Type="PivotPoint" />
        </cc:NavList>
        <Rectangle HorizontalAlignment="Stretch" Height="1" Margin="0, 5" Fill="#D3D3D3"/>
        <cc:FlatButton Content="Clear" Margin="10,5" Background="{StaticResource Blue500}" BorderBrush="{StaticResource Blue700}"
                       Foreground="{StaticResource PaperWhite1000}"
                         Command="{Binding ClearCommand}" CommandParameter="{Binding ElementName=listbox}"/>
    </StackPanel>
</UserControl>
