﻿<UserControl
    x:Class="UWP.CartesianChart.CustomTooltipAndLegend.CustomersLegend"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:UWP.CartesianChart.CustomTooltipAndLegend"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:lvc="using:LiveCharts.Uwp"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400"
    >
    <Grid Background="#555555" BorderThickness="2" Padding="20 10" BorderBrush="AntiqueWhite">
        <ItemsControl ItemsSource="{x:Bind Series}">
            <ItemsControl.ItemTemplate>
                <DataTemplate x:DataType="lvc:SeriesViewModel">
                    <Grid Margin="2">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Rectangle Grid.Column="0" Stroke="{Binding Stroke}" Fill="{Binding Fill}" 
                               Width="15" Height="15"/>
                        <TextBlock Grid.Column="1" Margin="4 0" Text="{Binding Title}" Foreground="White" VerticalAlignment="Center" />
                    </Grid>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </Grid>
</UserControl>
