<Page
    x:Class="FlexChartExplorer.AxisLabels"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:FlexChartExplorer"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Chart="using:C1.Xaml.Chart"
    xmlns:Xaml="using:C1.Xaml"
    mc:Ignorable="d"
    DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}"
    d:DesignHeight="300"
    d:DesignWidth="400">

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.Resources>
            <local:EnumConverter x:Key="enumConverter" />
            <Style TargetType="ComboBox">
                <Setter Property="ItemTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock>
                                <TextBlock.Inlines>
                                    <Run Text="{Binding OverlappingLabels_Caption, Source={StaticResource FlexChartExplorerLocalization}}"/>
                                    <Run Text="{Binding}" />
                                </TextBlock.Inlines>
                            </TextBlock>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Margin="10">
            <TextBlock Text="{Binding StaggeredLines_Caption, Source={StaticResource FlexChartExplorerLocalization}}" Margin="20 0 10 0" VerticalAlignment="Center" />
            <Xaml:C1NumericBox Value="{Binding ElementName=flexChart, Path=AxisX.StaggeredLines, Mode=TwoWay}" Minimum="1" Maximum="4" Width="160" />
            <ComboBox ItemsSource="{Binding OverlappingLabels}" SelectedValue="{Binding ElementName=flexChart, Path=AxisX.OverlappingLabels, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=OverlappingLabels}" Width="260" Margin="10 0 0 0"/>
        </StackPanel>
        <Chart:C1FlexChart x:Name="flexChart" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
                        ChartType="Column" BindingX="Country" Binding="GDP"
                        ItemsSource="{Binding Data}" ToolTipContent="{}{Country}&#x0a;{y:n0}" Grid.Row="1">
            <Chart:C1FlexChart.AxisX>
                <Chart:Axis StaggeredLines="2" />
            </Chart:C1FlexChart.AxisX>
            <Chart:C1FlexChart.AxisY>
                <Chart:Axis Format="#,," Title="GDP, trillion($)" AxisLine="False" MajorGrid="True" MajorTickMarks="None" />
            </Chart:C1FlexChart.AxisY>
            <Chart:Series />
        </Chart:C1FlexChart>
    </Grid>
</Page>
