<UserControl x:Class="ScratchNet.ParameterIndicator"
             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:script="clr-namespace:ScratchNet"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <script:CanBooleanConverter x:Key="CanBooleanConverter"/>
        <script:CanNumberConverter x:Key="CanNumberConverter"/>
        <script:ExpressionBarBackground x:Key="BarBackgroudConverter"/>
        <script:BooleanVisiblityConverter x:Key="BooleanVisiblityConverter"/>
    </UserControl.Resources>
    <Grid Name="ParameterGrid">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="auto"/>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Column="1" Name="ParamNameTextBox" Text="{Binding Path=Parameter.Name}" Padding="5,1,5,1" 
                       SnapsToDevicePixels="True"
                       Background="{Binding Path=Parameter, Converter={StaticResource BarBackgroudConverter}}"/>
        <Polygon Name="Polygon1" VerticalAlignment="Stretch" Points="0, 4, 4, 0, 4, 8"  Width="5"
                 Fill="{Binding Path=Parameter, Converter={StaticResource BarBackgroudConverter}}" 
                 Stretch="Fill"
                 SnapsToDevicePixels="True" 
                 Visibility="{Binding Path=Parameter.Type, Converter={StaticResource CanBooleanConverter}}"
                             />
        <Polygon Name="Polygon2" VerticalAlignment="Stretch" Stretch="Fill" Grid.Column="2" 
                 Points="0, 0, 0, 8, 4, 4" Width="5"
                 Fill="{Binding Path=Parameter, Converter={StaticResource BarBackgroudConverter}}" 
                 SnapsToDevicePixels="True" 
                 Visibility="{Binding Path=Parameter.Type, Converter={StaticResource CanBooleanConverter}}"
                             />
        <Border Name="Border1" VerticalAlignment="Stretch" CornerRadius="8,0,0,8 " Width="5" Grid.Column="0" 
                Background="{Binding Path=Parameter, Converter={StaticResource BarBackgroudConverter}}" 
                SnapsToDevicePixels="True" Visibility="{Binding Path=Parameter.Type, Converter={StaticResource CanNumberConverter}}"
                            />
        <Border Name="Border2" VerticalAlignment="Stretch" CornerRadius="0,8,8,0 " Width="5" Grid.Column="2" 
                Background="{Binding Path=Parameter, Converter={StaticResource BarBackgroudConverter}}"
                SnapsToDevicePixels="True" 
                Visibility="{Binding Path=Parameter.Type, Converter={StaticResource CanNumberConverter}}"
                            />
    </Grid>
</UserControl>
