<Window x:Class="Jeti_Test.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:Jeti_Test"
        mc:Ignorable="d"
        Title="JETI-Specbos2501 Test-App" Height="800" Width="1200" FontSize="20">

    <Window.Resources>
        <ResourceDictionary>
            <SolidColorBrush x:Key="MainWindowBackgroundBrush"
                   Color="Orange" />
        </ResourceDictionary>
    </Window.Resources>


    <Grid>
        <Grid.Resources>
            <Style TargetType="TextBox">
                <Setter Property="VerticalContentAlignment" Value="Center"/>
                <Setter Property="HorizontalContentAlignment" Value="Center"/>
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition Height="50"/>
            <RowDefinition Height="6*"/>
            <RowDefinition Height="2*"/>
            <RowDefinition Height="50"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Rectangle  Grid.Row="0" Grid.ColumnSpan="3" Fill="{DynamicResource {x:Static SystemColors.ActiveCaptionBrushKey}}" />
        <Label Content="JETI-Specbos2501 Test-App" Grid.ColumnSpan="3" HorizontalAlignment="Center"/>
        <Menu Grid.Row="1" Grid.ColumnSpan="3">
            <MenuItem Header="File" FontSize="30">
                <MenuItem Header="Exit" Click="mnuExitClick"/>
            </MenuItem>
        </Menu>
        <StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
            <Label Content="Status:"/>
            <Label Content="disconnected" Name="lblConnStatus" MouseDoubleClick="lblConnStatus_DoubleClick"/>
        </StackPanel>
        <Button Content="Start Measure" Grid.Column="1" Grid.Row="3" Height="80" Width="200" Name="btnStart" Click="btnStartClick" Background="#FFD26262"/>
        <Button Content="Draw Graph" Grid.Column="2" Grid.Row="3" Height="80" Width="200" Name="btnPolygon" Click="btnPolygon_Click">
            <Button.Background>
                <SolidColorBrush Color="{DynamicResource {x:Static SystemColors.MenuHighlightColorKey}}"/>
            </Button.Background>
        </Button>
        <StackPanel Background="Aqua" Grid.Row="2" Grid.Column="0" Margin="20">
            <Label Content="Integration time"/>
            <TextBox Text="0" x:Name="tbxIntTime" Height="40" Width="150" LostFocus="tbxIntTimeValidate" AutomationProperties.HelpText="Should be Zero for automatic adjustement"/>
            <Label Content="Averaging Count"/>
            <TextBox Text="1" x:Name="tbxAvgCount" Height="40" Width="150"/>
            <Label Content="nm Step"/>
            <TextBox Text="1" x:Name="tbxNmStep" Height="40" Width="150"/>
            <Label Content="nmStart"/>
            <TextBox Text="390" x:Name="tbxNmStart" Height="40" Width="150"/>
            <Label Content="nmEnd"/>
            <TextBox Text="700" x:Name="tbxNmEnd" Height="40" Width="150"/>

        </StackPanel>
        <StackPanel Background="LightSalmon" Grid.Row="2" Grid.Column="1" Margin="20">
            <Label Content="Peak Wavelength"/>
            <TextBox x:Name="tbxPkWavelength" Height="40" Width="150"/>
            <Label Content="Radiance"/>
            <TextBox x:Name="tbxRadiance" Height="40" Width="150"/>
            <Label Content="Result code"/>
            <TextBox x:Name="tbxResult" Height="40" Width="150"/>
            <Label Content="Conversion Time"/>
            <TextBox x:Name="tbxStopwatch" Height="40" Width="150"/>
        </StackPanel>
        <Canvas Grid.Row="2" Grid.Column="2" Name="canvas" Margin="20">
            <Polygon Points="{Binding Points}" Stroke="Black" StrokeThickness="2">
                <Polygon.Fill>
                    <LinearGradientBrush  EndPoint="0,0" StartPoint="1,0">
                        <GradientStop Color="Red" Offset="0.0" />
                        <GradientStop Color="Orange" Offset="0.17" />
                        <GradientStop Color="Yellow" Offset="0.33" />
                        <GradientStop Color="Green" Offset="0.5" />
                        <GradientStop Color="Blue" Offset="0.67" />
                        <GradientStop Color="Indigo" Offset="0.83" />
                        <GradientStop Color="Violet" Offset="1.0" />
                    </LinearGradientBrush>
                </Polygon.Fill>
            </Polygon>
        </Canvas>
    </Grid>
</Window>