<UserControl x:Class="FieldVisualizer.Windows.UserControls.VerticalLegend"
             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="clr-namespace:FieldVisualizer.Windows.UserControls"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid x:Name="grid">
        <StackPanel>
            <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="#FF868686"></TextBlock>
            <ListBox Name="LegendBox" ItemsSource="{Binding}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid Height="30" Width="190" VerticalAlignment="Top" Background="{DynamicResource {x:Static SystemColors.MenuBarBrushKey}}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="30"/>
                                <ColumnDefinition Width="10"/>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="10"/>
                            </Grid.ColumnDefinitions>
                            <CheckBox Name="ActiveCheckBox" Grid.Column="0" IsChecked="{Binding Path=IsActive}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            <Rectangle Grid.Column="1"  Margin="0,2,0,2" ToolTip="{Binding Path=RoundedValues.BottomValue}">
                                <Rectangle.Fill>
                                    <SolidColorBrush Color="{Binding Path=ExactValues.BottomColor}"/>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Rectangle Grid.Column="2"  Margin="0,2,0,2">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="1,1" StartPoint="0,0">
                                        <GradientStop Color="{Binding Path=ExactValues.BottomColor}"/>
                                        <GradientStop Color="{Binding Path=ExactValues.TopColor}" Offset="1"/>
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <TextBlock Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="#FF868686" Text="{Binding RoundedValues.AverageValue}"/>
                            <Rectangle Grid.Column="3" Margin="0,2,0,2" ToolTip="{Binding Path=RoundedValues.TopValue}">
                                <Rectangle.Fill>
                                    <SolidColorBrush Color="{Binding Path=ExactValues.TopColor}"/>
                                </Rectangle.Fill>
                            </Rectangle>
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </StackPanel>
        
    </Grid>
</UserControl>
