<Page
    x:Class="SparklineSamples.FlexGridIntegration"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:SparklineSamples"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:sp="using:C1.Xaml.Sparkline"
    xmlns:c1="using:C1.Xaml.FlexGrid"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" x:Name="Root">
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

        <c1:C1FlexGrid AutoGenerateColumns="False" ItemsSource="{Binding Sales, ElementName=Root}" AllowResizing="Both" IsReadOnly="True">
            <c1:C1FlexGrid.Columns>
                <c1:Column Header="Region" Binding="{Binding State}" />
                <c1:Column Header="Total Sales" Binding="{Binding TotalSalesFormatted}" />
                <c1:Column Header="Net Sales" Binding="{Binding NetSales}" />
                <c1:Column Header="Sales Trend" Binding="{Binding Data}" >
                    <c1:Column.CellTemplate>
                        <DataTemplate>
                            <sp:C1Sparkline Data="{Binding Data}" ShowMarkers="True" MarkersColor="#FF8C8C8C" SeriesColor="#FF88BDE6"/>
                        </DataTemplate>
                    </c1:Column.CellTemplate>
                </c1:Column>
                <c1:Column Header="Win/Loss" Binding="{Binding Data}">
                    <c1:Column.CellTemplate>
                        <DataTemplate>
                            <sp:C1Sparkline Data="{Binding Data}" SparklineType="Winloss" SeriesColor="#FF88BDE6" NegativeColor="#FFF07E6E" ShowNegative="True"/>
                        </DataTemplate>
                    </c1:Column.CellTemplate>
                </c1:Column>
                <c1:Column Header="Profit Trend" Binding="{Binding Data}" >
                    <c1:Column.CellTemplate>
                        <DataTemplate>
                            <sp:C1Sparkline Data="{Binding Data, Mode=OneWay}" SparklineType="Column" ShowHigh="True" ShowLow="True" LowMarkerColor="#FFF07E6E" HighMarkerColor="#FF90CD97"/>
                        </DataTemplate>
                    </c1:Column.CellTemplate>
                </c1:Column>
            </c1:C1FlexGrid.Columns>

        </c1:C1FlexGrid>
    </Grid>
</Page>
