<UserControl x:Class="FinancialChartExplorer.EventAnnotations"
             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:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:FinancialChartExplorer"
             xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
             DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="150"/>
        </Grid.RowDefinitions>
        <c1:C1FinancialChart x:Name="financialChart" ItemsSource="{Binding Data}"
                             ToolTipContent="{}Date: {Date}&#x000A;Open: {Open}&#x000A;High: {High}&#x000A;Low: {Low}&#x000A;Close: {Close}&#x000A;Volume: {Volume}"
                             ChartType="Candlestick"
                             BindingX="Date">
            <c1:C1FinancialChart.ToolTip>
                <ToolTip>
                    <ToolTip.ContentTemplate>
                        <DataTemplate>
                            <TextBlock local:TextBoxExt.FormattedText="{Binding}" TextWrapping="Wrap" MaxWidth="250"/>
                        </DataTemplate>
                    </ToolTip.ContentTemplate>
                </ToolTip>
            </c1:C1FinancialChart.ToolTip>
            <c1:FinancialSeries Binding="High,Low,Open,Close,Volume" SeriesName="BOX" ChartType="Line"/>
            <c1:C1FinancialChart.AxisX>
                <c1:Axis LabelAngle="45"/>
            </c1:C1FinancialChart.AxisX>
            <c1:C1FinancialChart.Layers>
                <c1:AnnotationLayer x:Name="annotationLayer">
                </c1:AnnotationLayer>
            </c1:C1FinancialChart.Layers>
        </c1:C1FinancialChart>
        <c1:C1FinancialChart x:Name="selectorChart" ItemsSource="{Binding Data}" ChartType="Candlestick" BindingX="Date" ToolTip="{x:Null}" Rendered="selectorChart_Rendered"  Grid.Row="1">
            <c1:FinancialSeries Binding="High,Low,Open,Close" SymbolSize="6"/>
            <c1:C1FinancialChart.AxisX>
                <c1:Axis LabelAngle="45" MajorUnit="3"/>
            </c1:C1FinancialChart.AxisX>
            <c1:C1FinancialChart.Layers>
                <c1:C1RangeSelector x:Name="selector" ValueChanged="rangeChanged"/>
            </c1:C1FinancialChart.Layers>
        </c1:C1FinancialChart>
    </Grid>
</UserControl>
