<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="ChartSamples.LegendCheckBox" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:local="clr-namespace:ChartSamples">
  <UserControl.Resources>
    <local:VisibilityConverter x:Key="vconv" />
  </UserControl.Resources>

  <Grid x:Name="LayoutRoot">
    <c1:C1Chart Name="chart" ChartType="LineSymbols">
      <c1:C1Chart.Data>
        <c1:ChartData>
          <c1:DataSeries Values="1,2,3,4" Label="series 1" />
          <c1:DataSeries Values="1,4,2,2" Label="series 2" />
          <c1:DataSeries Values="4,2,1,4" Label="series 3" />
        </c1:ChartData>
      </c1:C1Chart.Data>
      <c1:C1ChartLegend>
        <c1:C1ChartLegend.ItemTemplate>
          <DataTemplate>
            <StackPanel Orientation="Horizontal" Margin="0,-2,0,-2">
              <CheckBox Margin="0,2" VerticalAlignment="Center" IsChecked="{Binding Item.Visibility,Mode=TwoWay,Converter={StaticResource vconv}}" />

              <Canvas Width="24" Height="24" Background="Transparent">
                <ContentPresenter Canvas.Top="2" Content="{Binding Path=Line}" Width="24" Height="20" />
                <ContentPresenter Canvas.Left="5" Canvas.Top="5" Content="{Binding Path=Symbol}" Width="14" Height="14" />
              </Canvas>
              <TextBlock Margin="2" Text="{Binding Path=Label}" VerticalAlignment="Center" />
            </StackPanel>
          </DataTemplate>

        </c1:C1ChartLegend.ItemTemplate>
      </c1:C1ChartLegend>
    </c1:C1Chart>

  </Grid>
</UserControl>