<Page x:Class="FinancialChartExplorer.ArmsCandleVolume"
      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="using:FinancialChartExplorer"
      xmlns:Chart="using:C1.Xaml.Chart.Finance"
      mc:Ignorable="d" DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}"
      d:DesignHeight="300" d:DesignWidth="300">
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.Resources>
            <Style TargetType="ComboBox">
                <Setter Property="Margin" Value="10 0" />
                <Setter Property="Width" Value="120" />
                <Setter Property="ItemTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock Text="{Binding Name}"/>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Margin="10">
            <TextBlock Text="{Binding Path=Symbol, Source={StaticResource FinancialChartExplorerLocalization}}" VerticalAlignment="Center"/>
            <ComboBox x:Name="cbSymbol" ItemsSource="{Binding Companies}" SelectionChanged="OnSymbolSelectionChanged"/>
        </StackPanel>
        <Chart:C1FinancialChart x:Name="financialChart" ToolTipContent="{}Date: {Date}&#x000A;Open: {Open}&#x000A;High: {High}&#x000A;Low: {Low}&#x000A;Close: {Close}&#x000A;Volume: {Volume}" ChartType="ArmsCandleVolume" BindingX="Date" Binding="High,Low,Open,Close,Volume" Grid.Row="1">
            <Chart:FinancialSeries />
        </Chart:C1FinancialChart>
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="NarrowLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="0"/>
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="financialChart.FontSize" Value="12"/>
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="WideLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="420" />
                    </VisualState.StateTriggers>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</Page>
