<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:VIZ.Framework.Common"
                    xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core">

    <core:Bool2SolidColorBrushConverter x:Key="Bool2SolidColorBrushConverter"
                                        TrueBrush="Red" FalseBrush="Transparent" NoneBrush="Transparent"></core:Bool2SolidColorBrushConverter>

    <Style TargetType="local:GPIOPinTestControl">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
        <Setter Property="BorderBrush" Value="#ff3d4758"></Setter>
        <Setter Property="MinWidth" Value="300"></Setter>
        <Setter Property="MinHeight" Value="80"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:GPIOPinTestControl">
                    <Grid>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"></RowDefinition>
                                <RowDefinition Height="*"></RowDefinition>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                            </Grid.ColumnDefinitions>

                            <Rectangle Height="10" Fill="{TemplateBinding BorderBrush}" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4"
                                   VerticalAlignment="Top"></Rectangle>
                            <Rectangle Height="10" Fill="{TemplateBinding BorderBrush}" Grid.Row="0" Grid.Column="6" Grid.ColumnSpan="4"
                                   VerticalAlignment="Top"></Rectangle>
                            <Rectangle Height="10" Fill="{TemplateBinding BorderBrush}" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="10"
                                   VerticalAlignment="Bottom"></Rectangle>
                            <Rectangle Width="10" Fill="{TemplateBinding BorderBrush}" Grid.Row="0" Grid.Column="0" Grid.RowSpan="2"
                                   HorizontalAlignment="Left"></Rectangle>
                            <Rectangle Width="10" Fill="{TemplateBinding BorderBrush}" Grid.Row="0" Grid.Column="9" Grid.RowSpan="2"
                                   HorizontalAlignment="Right"></Rectangle>
                        </Grid>

                        <Grid Background="Transparent" Margin="10">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"></RowDefinition>
                                <RowDefinition Height="*"></RowDefinition>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                                <ColumnDefinition Width="*"></ColumnDefinition>
                            </Grid.ColumnDefinitions>

                            <Grid.Resources>
                                <Style TargetType="TextBlock">
                                    <Setter Property="Foreground" Value="White"></Setter>
                                    <Setter Property="FontSize" Value="12"></Setter>
                                    <Setter Property="HorizontalAlignment" Value="Center"></Setter>
                                    <Setter Property="VerticalAlignment" Value="Center"></Setter>
                                </Style>
                                <Style TargetType="Border">
                                    <Setter Property="Margin" Value="10"></Setter>
                                    <Setter Property="Background" Value="Transparent"></Setter>
                                </Style>
                            </Grid.Resources>

                            <!-- GND -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="0" Grid.Column="0">
                                <TextBlock Foreground="White" FontSize="14" Text="GND"></TextBlock>
                            </Border>
                            <!-- 15 -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="0" Grid.Column="1"
                                Background="{Binding Path=GPIOModel.PIN_15,RelativeSource={RelativeSource AncestorLevel=1,Mode=FindAncestor,AncestorType=local:GPIOPinTestControl},Converter={StaticResource Bool2SolidColorBrushConverter}}">
                                <TextBlock Foreground="White" FontSize="14" Text="15"></TextBlock>
                            </Border>
                            <!-- 14 -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="0" Grid.Column="2"
                                Background="{Binding Path=GPIOModel.PIN_14,RelativeSource={RelativeSource AncestorLevel=1,Mode=FindAncestor,AncestorType=local:GPIOPinTestControl},Converter={StaticResource Bool2SolidColorBrushConverter}}">
                                <TextBlock Foreground="White" FontSize="14" Text="14"></TextBlock>
                            </Border>
                            <!-- 13 -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="0" Grid.Column="3"
                                Background="{Binding Path=GPIOModel.PIN_13,RelativeSource={RelativeSource AncestorLevel=1,Mode=FindAncestor,AncestorType=local:GPIOPinTestControl},Converter={StaticResource Bool2SolidColorBrushConverter}}">
                                <TextBlock Foreground="White" FontSize="14" Text="13"></TextBlock>
                            </Border>
                            <!-- 12 -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="0" Grid.Column="4"
                                Background="{Binding Path=GPIOModel.PIN_12,RelativeSource={RelativeSource AncestorLevel=1,Mode=FindAncestor,AncestorType=local:GPIOPinTestControl},Converter={StaticResource Bool2SolidColorBrushConverter}}">
                                <TextBlock Foreground="White" FontSize="14" Text="12"></TextBlock>
                            </Border>
                            <!-- 11 -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="0" Grid.Column="5"
                                Background="{Binding Path=GPIOModel.PIN_11,RelativeSource={RelativeSource AncestorLevel=1,Mode=FindAncestor,AncestorType=local:GPIOPinTestControl},Converter={StaticResource Bool2SolidColorBrushConverter}}">
                                <TextBlock Foreground="White" FontSize="14" Text="11"></TextBlock>
                            </Border>
                            <!-- 10 -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="0" Grid.Column="6"
                                Background="{Binding Path=GPIOModel.PIN_10,RelativeSource={RelativeSource AncestorLevel=1,Mode=FindAncestor,AncestorType=local:GPIOPinTestControl},Converter={StaticResource Bool2SolidColorBrushConverter}}">
                                <TextBlock Foreground="White" FontSize="14" Text="10"></TextBlock>
                            </Border>
                            <!-- 9 -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="0" Grid.Column="7"
                                Background="{Binding Path=GPIOModel.PIN_9,RelativeSource={RelativeSource AncestorLevel=1,Mode=FindAncestor,AncestorType=local:GPIOPinTestControl},Converter={StaticResource Bool2SolidColorBrushConverter}}">
                                <TextBlock Foreground="White" FontSize="14" Text="9"></TextBlock>
                            </Border>
                            <!-- 8 -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="0" Grid.Column="8"
                                Background="{Binding Path=GPIOModel.PIN_8,RelativeSource={RelativeSource AncestorLevel=1,Mode=FindAncestor,AncestorType=local:GPIOPinTestControl},Converter={StaticResource Bool2SolidColorBrushConverter}}">
                                <TextBlock Foreground="White" FontSize="14" Text="8"></TextBlock>
                            </Border>
                            <!--  -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="0" Grid.Column="9">
                                <TextBlock Foreground="White" FontSize="14" Text="3.3V"></TextBlock>
                            </Border>
                            <!-- GND -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="1" Grid.Column="0">
                                <TextBlock Foreground="White" FontSize="14" Text="GND"></TextBlock>
                            </Border>
                            <!-- 7 -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="1" Grid.Column="1"
                                Background="{Binding Path=GPIOModel.PIN_7,RelativeSource={RelativeSource AncestorLevel=1,Mode=FindAncestor,AncestorType=local:GPIOPinTestControl},Converter={StaticResource Bool2SolidColorBrushConverter}}">
                                <TextBlock Foreground="White" FontSize="14" Text="7"></TextBlock>
                            </Border>
                            <!-- 6 -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="1" Grid.Column="2"
                                Background="{Binding Path=GPIOModel.PIN_6,RelativeSource={RelativeSource AncestorLevel=1,Mode=FindAncestor,AncestorType=local:GPIOPinTestControl},Converter={StaticResource Bool2SolidColorBrushConverter}}">
                                <TextBlock Foreground="White" FontSize="14" Text="6"></TextBlock>
                            </Border>
                            <!-- 5 -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="1" Grid.Column="3"
                                Background="{Binding Path=GPIOModel.PIN_5,RelativeSource={RelativeSource AncestorLevel=1,Mode=FindAncestor,AncestorType=local:GPIOPinTestControl},Converter={StaticResource Bool2SolidColorBrushConverter}}">
                                <TextBlock Foreground="White" FontSize="14" Text="5"></TextBlock>
                            </Border>
                            <!-- 4 -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="1" Grid.Column="4"
                                Background="{Binding Path=GPIOModel.PIN_4,RelativeSource={RelativeSource AncestorLevel=1,Mode=FindAncestor,AncestorType=local:GPIOPinTestControl},Converter={StaticResource Bool2SolidColorBrushConverter}}">
                                <TextBlock Foreground="White" FontSize="14" Text="4"></TextBlock>
                            </Border>
                            <!-- 3 -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="1" Grid.Column="5"
                                Background="{Binding Path=GPIOModel.PIN_3,RelativeSource={RelativeSource AncestorLevel=1,Mode=FindAncestor,AncestorType=local:GPIOPinTestControl},Converter={StaticResource Bool2SolidColorBrushConverter}}">
                                <TextBlock Foreground="White" FontSize="14" Text="3"></TextBlock>
                            </Border>
                            <!-- 2 -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="1" Grid.Column="6"
                                Background="{Binding Path=GPIOModel.PIN_2,RelativeSource={RelativeSource AncestorLevel=1,Mode=FindAncestor,AncestorType=local:GPIOPinTestControl},Converter={StaticResource Bool2SolidColorBrushConverter}}">
                                <TextBlock Foreground="White" FontSize="14" Text="2"></TextBlock>
                            </Border>
                            <!-- 1 -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="1" Grid.Column="7"
                                Background="{Binding Path=GPIOModel.PIN_1,RelativeSource={RelativeSource AncestorLevel=1,Mode=FindAncestor,AncestorType=local:GPIOPinTestControl},Converter={StaticResource Bool2SolidColorBrushConverter}}">
                                <TextBlock Foreground="White" FontSize="14" Text="1"></TextBlock>
                            </Border>
                            <!-- 0 -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="1" Grid.Column="8"
                                Background="{Binding Path=GPIOModel.PIN_0,RelativeSource={RelativeSource AncestorLevel=1,Mode=FindAncestor,AncestorType=local:GPIOPinTestControl},Converter={StaticResource Bool2SolidColorBrushConverter}}">
                                <TextBlock Foreground="White" FontSize="14" Text="0"></TextBlock>
                            </Border>
                            <!-- 5.0V -->
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="2" Grid.Row="1" Grid.Column="9">
                                <TextBlock Foreground="White" FontSize="14" Text="5.0V"></TextBlock>
                            </Border>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>