<UserControl x:Class="ProximaAnalizer.Views.DBInfoAlarmRegions.AlarmData"
             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:ProximaAnalizer.Views.DBInfoAlarmRegions"
             xmlns:converter="clr-namespace:ProximaAnalizer.Converter"
             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
             xmlns:prism="http://prismlibrary.com/"
             prism:ViewModelLocator.AutoWireViewModel="True"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/UICommon;component/Resources.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <converter:MFCUnitConverter x:Key="MFCUnitConvert"/>
            <converter:LeakCheckNameConvert x:Key="LeakCheckName"/>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="226"/>
            <RowDefinition Height="4"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <ScrollViewer Grid.Row="0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">
            <WrapPanel>
                <GroupBox Header="Heater" Margin="4">
                    <DataGrid ItemsSource="{Binding Heaters.Data}" x:Name="HeaterGrid"
                              SelectedItem="{Binding Selected}"
                            Margin="8"
                            IsReadOnly="True"
                            CanUserAddRows="False"
                            CanUserDeleteRows="False"
                            CanUserResizeRows="False"
                            CanUserSortColumns="False"
                            GridLinesVisibility="All"
                            HorizontalGridLinesBrush="{StaticResource DarkBorderColor}"
                            VerticalGridLinesBrush="{StaticResource DarkBorderColor}"
                            AutoGenerateColumns="False"
                            ColumnHeaderHeight="22"
                            RowHeight="22"
                            VerticalAlignment="Top"
                            BorderBrush="{StaticResource DarkBorderColor}"                              
                             Background="{StaticResource BackgroundColor}" >
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="SelectionChanged">
                                <i:InvokeCommandAction Command="{Binding SelectDataCommand}"
                                                       CommandParameter="{Binding Heaters.Keys}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                        <DataGrid.Columns>
                            <DataGridTemplateColumn Width="120" Header="Heater Zone">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Key}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="Feedback">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[TempFeedback] ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="SetPoint">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[TempSetPoint] ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="Mode">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[ControlMode]}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="CascadePV">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[CascadePV] ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>


                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="CascadeSV">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[CascadeControlModeSV] ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="HeaterPV">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[HeaterPV] ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="HeaterSV">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[HeaterControlModeSV] ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="HeaterMode">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[HeaterControlModeSV]}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>


                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="OverTemp">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[OverTemp] ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="UpRate">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[UpRate] ,StringFormat=0.0}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="DownRate">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[DownRate] ,StringFormat=0.0}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="Output">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock >
                                        <Run Text="{Binding Value[WorkingOutput] ,StringFormat=0.0}"/>
                                        <Run>%</Run>
                                        </TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                </GroupBox>

                <GroupBox  Header="APCVATGV" Margin="4">
                    <DataGrid ItemsSource="{Binding APCVATGVs.Data}"
                              SelectedItem="{Binding Selected}"

                             Margin="8"
                             IsReadOnly="True"
                             CanUserAddRows="False"
                             CanUserDeleteRows="False"
                             CanUserResizeRows="False"
                             CanUserSortColumns="False"
                             GridLinesVisibility="All"
                             HorizontalGridLinesBrush="{StaticResource DarkBorderColor}"
                             VerticalGridLinesBrush="{StaticResource DarkBorderColor}"
                             AutoGenerateColumns="False"
                             ColumnHeaderHeight="22"
                             RowHeight="22"
                             VerticalAlignment="Top"
                             BorderBrush="{StaticResource DarkBorderColor}"                              
                             Background="{StaticResource BackgroundColor}" >
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="SelectionChanged">
                                <i:InvokeCommandAction Command="{Binding SelectDataCommand}"
                                                       CommandParameter="{Binding APCVATGVs.Keys}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                        <DataGrid.Columns>
                            <DataGridTemplateColumn Width="auto" MinWidth="100" Header="Name">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Key}" Margin="8,0"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="60" Header="Value">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                </GroupBox>

                <GroupBox  Header="Pressure" Margin="4">
                    <DataGrid ItemsSource="{Binding Pressures.Data}"
                              SelectedItem="{Binding Selected}"
                             Margin="8"
                             IsReadOnly="True"
                             CanUserAddRows="False"
                             CanUserDeleteRows="False"
                             CanUserResizeRows="False"
                             CanUserSortColumns="False"
                             GridLinesVisibility="All"
                             HorizontalGridLinesBrush="{StaticResource DarkBorderColor}"
                             VerticalGridLinesBrush="{StaticResource DarkBorderColor}"
                             AutoGenerateColumns="False"
                             ColumnHeaderHeight="22"
                             RowHeight="22"
                             VerticalAlignment="Top"
                             BorderBrush="{StaticResource DarkBorderColor}"                              
                             Background="{StaticResource BackgroundColor}" >
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="SelectionChanged">
                                <i:InvokeCommandAction Command="{Binding SelectDataCommand}"
                                                       CommandParameter="{Binding Pressures.Keys}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                        <DataGrid.Columns>
                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="Name">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Key}" Margin="8,0"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="60" Header="Torr">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                </GroupBox>

                <GroupBox  Header="LeakCheck"  Margin="4">
                    <DataGrid ItemsSource="{Binding LeakChecks.Data}" 
                              SelectedItem="{Binding Selected}"
                             Margin="8"
                             IsReadOnly="True"
                             CanUserAddRows="False"
                             CanUserDeleteRows="False"
                             CanUserResizeRows="False"
                             CanUserSortColumns="False"
                             GridLinesVisibility="All"
                             HorizontalGridLinesBrush="{StaticResource DarkBorderColor}"
                             VerticalGridLinesBrush="{StaticResource DarkBorderColor}"
                             AutoGenerateColumns="False"
                             ColumnHeaderHeight="22"
                             RowHeight="22"
                             VerticalAlignment="Top"
                             BorderBrush="{StaticResource DarkBorderColor}"                              
                             Background="{StaticResource BackgroundColor}" >
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="SelectionChanged">
                                <i:InvokeCommandAction Command="{Binding SelectDataCommand}"
                                                       CommandParameter="{Binding LeakChecks.Keys}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                        <DataGrid.Columns>
                            <DataGridTemplateColumn Width="auto" MinWidth="100" Header="Name">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Key, Converter={StaticResource ResourceKey=LeakCheckName}}" Margin="8,0"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="60" Header="Value">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                </GroupBox>
            </WrapPanel>
        </ScrollViewer>

        <ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">
            <WrapPanel >
                <GroupBox Header="MFC" Margin="4">
                    <DataGrid ItemsSource="{Binding MFCs.Data}"
                              SelectedItem="{Binding Selected}"
                             Margin="8"
                             IsReadOnly="True"
                             CanUserAddRows="False"
                             CanUserDeleteRows="False"
                             CanUserResizeRows="False"
                             CanUserSortColumns="False"
                             GridLinesVisibility="All"
                             HorizontalGridLinesBrush="{StaticResource DarkBorderColor}"
                             VerticalGridLinesBrush="{StaticResource DarkBorderColor}"
                             AutoGenerateColumns="False"
                             ColumnHeaderHeight="22"
                             RowHeight="22"
                             VerticalAlignment="Top"
                             BorderBrush="{StaticResource DarkBorderColor}"                              
                             Background="{StaticResource BackgroundColor}" >
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="SelectionChanged">
                                <i:InvokeCommandAction Command="{Binding SelectDataCommand}"
                                                       CommandParameter="{Binding MFCs.Keys}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                        <DataGrid.Columns>
                            <DataGridTemplateColumn Width="auto" MinWidth="100" Header="Name">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Key}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="FeedBack">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[Feedback] ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="VirtualFeedBack">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[VirtualFeedBack] ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="SetPoint">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[SetPoint] ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>


                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="LastSetPoint">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[LastSetPoint] ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="Ramp">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[Ramping] ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="Unit">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[MFCUnitEnum] ,Converter={StaticResource MFCUnitConvert}}"/>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                </GroupBox>

                <GroupBox  Header="Valve" Margin="4">
                    <DataGrid ItemsSource="{Binding Valves.Data}"
                              SelectedItem="{Binding Selected}"
                           Margin="8"
                           IsReadOnly="True"
                           CanUserAddRows="False"
                           CanUserDeleteRows="False"
                           CanUserResizeRows="False"
                           CanUserSortColumns="False"
                           GridLinesVisibility="All"
                           HorizontalGridLinesBrush="{StaticResource DarkBorderColor}"
                           VerticalGridLinesBrush="{StaticResource DarkBorderColor}"
                           AutoGenerateColumns="False"
                           ColumnHeaderHeight="22"
                           RowHeight="22"
                           VerticalAlignment="Top"
                           BorderBrush="{StaticResource DarkBorderColor}"                              
                           Background="{StaticResource BackgroundColor}" >
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="SelectionChanged">
                                <i:InvokeCommandAction Command="{Binding SelectDataCommand}"
                                                       CommandParameter="{Binding Valves.Keys}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                        <DataGrid.Columns>
                            <DataGridTemplateColumn Width="auto" MinWidth="100" Header="Name">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Key}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="Actual">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[Status] ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="SetPoint">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[SetPoint]}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                </GroupBox>

                <GroupBox  Header="GaslineHeater" Margin="4">
                    <DataGrid ItemsSource="{Binding GaslineHeaters.Data}"
                              SelectedItem="{Binding Selected}"
                               Margin="8"
                               IsReadOnly="True"
                               CanUserAddRows="False"
                               CanUserDeleteRows="False"
                               CanUserResizeRows="False"
                               CanUserSortColumns="False"
                               GridLinesVisibility="All"
                               HorizontalGridLinesBrush="{StaticResource DarkBorderColor}"
                               VerticalGridLinesBrush="{StaticResource DarkBorderColor}"
                               AutoGenerateColumns="False"
                               ColumnHeaderHeight="22"
                               RowHeight="22"
                                VerticalAlignment="Top"
                                BorderBrush="{StaticResource DarkBorderColor}"                              
                               Background="{StaticResource BackgroundColor}" >
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="SelectionChanged">
                                <i:InvokeCommandAction Command="{Binding SelectDataCommand}"
                                                       CommandParameter="{Binding GaslineHeaters.Keys}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                        <DataGrid.Columns>
                            <DataGridTemplateColumn Width="auto" MinWidth="100" Header="Name">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Key}" Margin="8,0"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="Feedback">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[TempFeedback] ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="SetPoint">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[TempSetPoint],StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                </GroupBox>

                <GroupBox  Header="FFU" Margin="4">
                    <DataGrid ItemsSource="{Binding FFUs.Data}"
                              SelectedItem="{Binding Selected}"
                               Margin="8"
                               IsReadOnly="True"
                               CanUserAddRows="False"
                               CanUserDeleteRows="False"
                               CanUserResizeRows="False"
                               CanUserSortColumns="False"
                               GridLinesVisibility="All"
                               HorizontalGridLinesBrush="{StaticResource DarkBorderColor}"
                               VerticalGridLinesBrush="{StaticResource DarkBorderColor}"
                               AutoGenerateColumns="False"
                               ColumnHeaderHeight="22"
                               RowHeight="22"
                                VerticalAlignment="Top"
                                BorderBrush="{StaticResource DarkBorderColor}"
                               Background="{StaticResource BackgroundColor}" >
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="SelectionChanged">
                                <i:InvokeCommandAction Command="{Binding SelectDataCommand}"
                                                       CommandParameter="{Binding FFUs.Keys}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                        <DataGrid.Columns>
                            <DataGridTemplateColumn Width="auto" MinWidth="100" Header="Name">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Key}" Margin="8,0"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="IsSwitch">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[IsSwitch] ,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="Speed">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value[CurrentSpeed]}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                </GroupBox>

                <GroupBox  Header="APC" Margin="4">
                    <DataGrid ItemsSource="{Binding APCs.Data}"
                              SelectedItem="{Binding Selected}"
                                Margin="8"
                                IsReadOnly="True"
                                CanUserAddRows="False"
                                CanUserDeleteRows="False"
                                CanUserResizeRows="False"
                                CanUserSortColumns="False"
                                GridLinesVisibility="All"
                                HorizontalGridLinesBrush="{StaticResource DarkBorderColor}"
                                VerticalGridLinesBrush="{StaticResource DarkBorderColor}"
                                AutoGenerateColumns="False"
                                ColumnHeaderHeight="22"
                                RowHeight="22"
                                VerticalAlignment="Top"
                                BorderBrush="{StaticResource DarkBorderColor}"
                                Background="{StaticResource BackgroundColor}" >
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="SelectionChanged">
                                <i:InvokeCommandAction Command="{Binding SelectDataCommand}"
                                                       CommandParameter="{Binding APCs.Keys}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                        <DataGrid.Columns>
                            <DataGridTemplateColumn Width="auto" MinWidth="100" Header="Name">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Key}" Margin="8,0"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>

                            <DataGridTemplateColumn Width="auto" MinWidth="80" Header="Value">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Value,StringFormat=0.00}"></TextBlock>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                            </DataGridTemplateColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                </GroupBox>

            </WrapPanel>
        </ScrollViewer>
    </Grid>
</UserControl>
