<UserControl x:Class="MECF.Framework.UI.Client.Ctrlib.Controls.HeaterResPresenter"
             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:MECF.Framework.UI.Client.Ctrlib.Controls"
             xmlns:deviceControl="clr-namespace:Aitex.Core.UI.DeviceControl;assembly=MECF.Framework.UI.Core"
             xmlns:ioDevice="clr-namespace:Aitex.Core.Common.DeviceData.IoDevice;assembly=MECF.Framework.Common"
             mc:Ignorable="d"
             d:DesignHeight="450" d:DesignWidth="800"
             d:DataContext="{d:DesignInstance Type=ioDevice:IoPsuData, IsDesignTimeCreatable=False}">
    <UserControl.Resources>
        <local:IoPsuResistanceSummaryConverter x:Key="resSummaryConverter" />
    </UserControl.Resources>
    <Grid Margin="0,0,0,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="23" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0" />
            <ColumnDefinition />
            <ColumnDefinition Width="50" />
            <ColumnDefinition Width="70" />
        </Grid.ColumnDefinitions>

        <Border
            Grid.Row="0"
            Grid.Column="0"
            Grid.ColumnSpan="2"
            Padding="5,1"
            Background="{DynamicResource Table_BG_Title_Inner}"
            BorderBrush="{DynamicResource Table_BD}"
            BorderThickness="1,0,1,1">
            <TextBlock
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Text="{Binding Caption, 
                RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}}"
                TextWrapping="Wrap" />
        </Border>
        <Border
            Grid.Row="0"
            Grid.Column="2"
            Padding="5,1"
            Background="{DynamicResource Table_BG_Content_Inner}"
            BorderBrush="{DynamicResource Table_BD}"
            BorderThickness="0,0,1,1">

            <deviceControl:AITSensor
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                CustomColorOff="Lime"
                CustomColorOn="Red"
                IsCustomRender="True"
                LightOnValue="{Binding IsResistanceOutOfRange}" />
        </Border>

        <Border
            Grid.Row="0"
            Grid.Column="3"
            Padding="5,1"
            Background="{DynamicResource Table_BG_Content_Inner}"
            BorderBrush="{DynamicResource Table_BD}"
            BorderThickness="0,0,1,1">
            <TextBlock 
                HorizontalAlignment="Center"
                Text="{Binding Resistance, StringFormat={}{0:F3}}"
                ToolTip="{Binding Converter={StaticResource resSummaryConverter}}" />
        </Border>

    </Grid>
</UserControl>