<Window x:Class="DeviceStatusCSharp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:DeviceStatusCSharp"
        mc:Ignorable="d"
        Title="Device Status" Height="480" Width="450" Loaded="Window_Loaded" Closing="Window_Closing">
    <DockPanel LastChildFill="True">
        <Grid DockPanel.Dock="Left" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <GroupBox x:Name="groupBoxDevice" Header="Device">
                <Grid Margin="5">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Label x:Name="labelDevice" Content="Device:" Margin="3"/>
                    <ComboBox x:Name="comboBoxDevice" Grid.Column="1" Margin="3,3,0,3" SelectionChanged="ComboBoxDevice_SelectionChanged" HorizontalAlignment="Stretch"/>
                    <Label x:Name="labelDuplex" Content="Duplex Mode:"  Grid.Row="1" Margin="3"/>
                    <TextBlock x:Name="textBlockDuplex" Grid.Row="1" Grid.Column="1" Margin="3" Padding="5" HorizontalAlignment="Stretch"/>
                </Grid>
            </GroupBox>
            <GroupBox x:Name="groupBoxStatus" Header="Status" Grid.Row="1">
                <DataGrid Name="dataGridStatus" ItemsSource="{Binding StatusData, UpdateSourceTrigger=PropertyChanged}" AutoGenerateColumns="False" GridLinesVisibility="None" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" HeadersVisibility="Column" Background="Transparent" RowBackground="Transparent" CanUserAddRows="False" IsReadOnly="True" AlternatingRowBackground="#FFF0F0F0">
                    <DataGrid.Resources>
                        <Style TargetType="{x:Type DataGridCell}">
                            <Setter Property="VerticalAlignment" Value="Center" />
                        </Style>
                    </DataGrid.Resources>
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="Item" Binding="{Binding Item}" Width="250" />
                        <DataGridTextColumn Header="Value" Binding="{Binding Value}" Width="*" />
                    </DataGrid.Columns>
                </DataGrid>
            </GroupBox>
        </Grid>
    </DockPanel>
</Window>
