<Window 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:eDosStation"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
        x:Class="eDosStation.EntryBadge"
        mc:Ignorable="d"
        Title="EntryBadge" 
        Height="980" Width="1820"  ResizeMode="NoResize" 
        FontFamily="Segoe UI"  FontSize="36"
        Loaded="Window_Loaded"  
        WindowStartupLocation="CenterScreen" WindowState="Maximized" Closing="Window_Closing" 
        >
    <Window.Resources>
        <local:DataSet1 x:Key="dataSet1"/>
        <CollectionViewSource x:Key="getTaskListViewSource" Source="{Binding GetTaskInfo, Source={StaticResource dataSet1}}" />
        <Style x:Key="tblIssuedLabel" TargetType="TextBlock">
            <Setter Property="Background" Value="{StaticResource sckbLB}" />
            <Setter Property="Padding" Value="20,0,20,0" />
            <Setter Property="TextAlignment" Value="Right"/>
        </Style>
        <Style x:Key="tblIssuedValue" TargetType="TextBlock">
            <Setter Property="TextAlignment" Value="Right" />
            <Setter Property="Padding" Value="20,0,20,0" />
        </Style>
        <Style x:Key="tblIssuedValueTitle" TargetType="TextBlock">
            <Setter Property="TextAlignment" Value="Right" />
            <Setter Property="Padding" Value="20,0,20,0" />
            <Setter Property="FontWeight" Value="Bold"/>
        </Style>


    </Window.Resources>
    <DockPanel VerticalAlignment="Top">
        <StackPanel DockPanel.Dock="Top" HorizontalAlignment="Left">
            <Image Source="/Images/logoh120.png" Height="60"/>
        </StackPanel>
        <StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Center">
            <!--<StaticResource ResourceKey="tbFooter" />-->
        </StackPanel>
        <TabControl Name="tb" TabStripPlacement="Top"  VerticalAlignment="Center"  >
            <TabItem Name="tbEntry" VerticalAlignment="Center" >
                <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,100,10,10" >
                    <Border Background="{Binding Mode=OneWay, Source={StaticResource sckbLB}}" TextBlock.FontSize="24" TextBlock.LineHeight="30px" Padding="20,20,20,20" CornerRadius="10" BorderThickness="2" BorderBrush="Blue"  >
                        <StackPanel HorizontalAlignment="Center"  >
                            <TextBlock  TextAlignment="Center" Padding="10,10,10,10" >
                                <LineBreak/>
                                <Image Source="/Images/Mannetjet.png" Width="60" Margin="0,0,50,0"/>

                            <Run Foreground="{Binding Mode=OneWay, Source={StaticResource sckbP}}" FontSize="28" FontWeight="Bold">Welcome to eDOS</Run>
                                <LineBreak/><LineBreak/>
                            <Run Background="LightGreen">Entry Process is ready</Run>
                                <LineBreak/><LineBreak/>
                            <Run>Please scan your badge on the badge reader</Run>
                                <LineBreak/><LineBreak/>
                            </TextBlock>
                        </StackPanel>
                    </Border>
                    <StackPanel VerticalAlignment="Center">
                        <telerik:RadButton Name="LeesCancel" Content="Cancel" Click="LeesCancel_Click"  Margin="20,20,0,0" Style="{DynamicResource OkCancelButton}"  />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock x:Name="CSN" />
                        <TextBlock x:Name="Site" />
                        <TextBlock x:Name="Code" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="0,50,0,0" Name="pTestButtons" Visibility="Collapsed" />
                </StackPanel>
            </TabItem>
            <TabItem Name="tbUser" VerticalAlignment="Center" >
                <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Vertical" Margin="50,50,50,50">
                    <Border Background="AliceBlue" TextBlock.FontSize="20" Padding="20,20,20,20" >
                        <StackPanel HorizontalAlignment="Center"  >
                            <TextBlock Name="Username" Text="" TextAlignment="Center" Margin="0,20,0,20" HorizontalAlignment="Stretch"/>
                            <TextBlock Name="UserAccess" Text="Welcome to eDOS" TextAlignment="Center" MaxWidth="600" TextWrapping="Wrap" HorizontalAlignment="Stretch" />
                        </StackPanel>
                    </Border>
                    <Border Name="boxComment" Background="AliceBlue" TextBlock.FontSize="15" Padding="20,20,20,20"  >
                        <StackPanel HorizontalAlignment="Center"  >
                            <TextBlock Text="Comment" />
                            <TextBlock x:Name="UserComment"  />
                        </StackPanel>
                    </Border>
                    <ProgressBar x:Name="pUserSeconds" Background="Blue" Value="5" Maximum="10" Tag="AA"   >
                        <ProgressBar.Effect>
                            <DropShadowEffect/>
                        </ProgressBar.Effect>
                    </ProgressBar>
                    <TextBlock x:Name="tUserSeconds" Text="10" TextAlignment="Center" HorizontalAlignment="Stretch" />
                    <telerik:RadButton Content="OK" Name="bUserRead" Click="BUserRead_Click" Style="{DynamicResource OkCancelButton}" Margin="50,50,50,50"/>
                </StackPanel>
            </TabItem>
            <TabItem  Name="tbTask" VerticalAlignment="Top">
                <Grid DataContext="{Binding Mode=OneWay, Source={StaticResource getTaskListViewSource}}" >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="*"   />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="80" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Row="0" Grid.ColumnSpan="2" Text="Naam" Name="Naam" HorizontalAlignment="Stretch" TextAlignment="Center" FontWeight="Bold" Background="Azure" FontSize="15"  />
                    <Border Grid.Row="1" Grid.ColumnSpan="2" Background="{StaticResource sckbLB}"  HorizontalAlignment="Stretch" CornerRadius="10" VerticalAlignment="Top"  >
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <StackPanel Orientation="Horizontal" Grid.Column="0">
                                <telerik:RadToggleButton Name="cbNormal" HorizontalAlignment="Left" Width="150" Content="Normal" TextBlock.FontSize="24" Click="CbNormal_Click" IsChecked="True" CornerRadius="15" />
                                <telerik:RadToggleButton Name="cbAlara" HorizontalAlignment="Left" Width="150" Content="Alara" TextBlock.FontSize="24" Click="CbAlara_Click" IsChecked="False" CornerRadius="15" />
                            </StackPanel>
                            <TextBlock Grid.Column="1"  FontSize="36" TextAlignment="Center"  Text="Choose a task"  />
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Column="3">
                                <telerik:RadToggleButton Name="cbInst1" HorizontalAlignment="Left" Width="150" Content="Inst1" TextBlock.FontSize="24" Click="CbInst1_Click" IsChecked="True" CornerRadius="15" />
                                <telerik:RadToggleButton Name="cbInst2" HorizontalAlignment="Left" Width="150" Content="Inst2" TextBlock.FontSize="24" Click="CbInst2_Click" IsChecked="false" Visibility="Collapsed"  CornerRadius="15" />
                            </StackPanel>
                        </Grid>
                    </Border>
                    <StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Vertical" VerticalAlignment="Top" HorizontalAlignment="Stretch"   >
                        <ScrollViewer VerticalScrollBarVisibility="Visible"  Style="{Binding Mode=OneWay, Source={StaticResource CustomScrollViewer}}" MaxHeight="753">
                            <ListBox ItemsSource="{Binding Mode=OneWay}" SelectedValuePath="ID_Task" SelectionChanged="ListBox_SelectionChanged" ScrollViewer.CanContentScroll="False"  >
                                <ListBox.ItemsPanel >
                                    <ItemsPanelTemplate  >
                                        <telerik:RadUniformGrid Columns="3" IsItemsHost="True"   />
                                    </ItemsPanelTemplate>
                                </ListBox.ItemsPanel>
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal" TextBlock.FontSize="20" Margin="5,5,5,5" Height="20" >
                                            <TextBlock Text="{Binding TaskType_CODE}" Width="60" TextWrapping="NoWrap" FontSize="18"  >
                                                <TextBlock.Style>
                                                    <Style TargetType="TextBlock">
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding EPDRad}" Value="BG">
                                                                <Setter Property="Background" Value="LightGray"></Setter>
                                                            </DataTrigger>
                                                            <DataTrigger Binding="{Binding EPDRad}" Value="NG">
                                                                <Setter Property="Background" Value="Black"></Setter>
                                                                <Setter Property="Foreground" Value="White"></Setter>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </TextBlock.Style>
                                            </TextBlock>
                                            <TextBlock Text="{Binding Task_Name}" Width="410" FontSize="17" TextWrapping="Wrap" />
                                        </StackPanel>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                            <!--<telerik:RadMultiColumnComboBox DisplayMemberPath="Task_Name" Width="700" HorizontalAlignment="Stretch"  >
                    <telerik:RadMultiColumnComboBox.ItemsSourceProvider>
                        <telerik:GridViewItemsSourceProvider ItemsSource="{Binding}" />
                    </telerik:RadMultiColumnComboBox.ItemsSourceProvider>
                </telerik:RadMultiColumnComboBox>-->
                        </ScrollViewer>

                    </StackPanel>
                    <Grid Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" Margin="10,10,10,10" TextBlock.FontSize="12" TextBlock.LineHeight="12"   >
                        <Grid.RowDefinitions>
                            <RowDefinition Height="50"  />
                            <RowDefinition Height="auto"  />
                            <RowDefinition Height="auto"  />
                            <RowDefinition Height="auto"  />
                            <RowDefinition Height="auto"  />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"  />
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                        </Grid.ColumnDefinitions>
                        <Image Grid.Row="0" Grid.RowSpan="5" Height="60" VerticalAlignment="Center" Margin="5,10,50,5" >
                            <Image.Style>
                                <Style TargetType="{x:Type Image}">
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding EPDRad}" Value="BG">
                                            <Setter Property="Source" Value="{StaticResource iBG}"></Setter>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding EPDRad}" Value="NG">
                                            <Setter Property="Source" Value="{StaticResource iNG}"></Setter>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Image.Style>
                        </Image>
                        <TextBlock  Grid.Row="1" Grid.Column="1"   >
                            <Run FontWeight="Bold" Text="Task: "/>
                            <Run Text="{Binding ID_Task,Mode=OneWay}" />
                        </TextBlock>
                        <TextBlock  Grid.Row="1" Grid.Column="2"   >
                            <Run FontWeight="Bold" Text="Hp07Dose: "/>
                            <Run Text="{Binding Hp07Dose,Mode=OneWay,StringFormat={}{0:0.00} µSv}" />
                        </TextBlock>
                        <TextBlock  Grid.Row="1" Grid.Column="3"  >
                            <Run FontWeight="Bold" Text="Hp10Dose L: "/>
                            <Run Text="{Binding Hp10Dose1,StringFormat={}{0:0.00} µSv}" />
                            <Run FontWeight="Bold" Text="H: "/>
                            <Run Text="{Binding Hp10Dose2,StringFormat={}{0:0.00} µSv}" />
                        </TextBlock>
                        <TextBlock  Grid.Row="2" Grid.Column="1"  >
                            <Run FontWeight="Bold" Text="Hp07Rate Off: "/>
                            <Run Text="{Binding HP07RateOFF,StringFormat={}{0:0.00} µSv/h}" />
                            <Run FontWeight="Bold" Text=" On: "/>
                            <Run Text="{Binding HP07RateON,StringFormat={}{0:0.00} µSv/h}" />
                        </TextBlock>
                        <TextBlock  Grid.Row="2" Grid.Column="2"  >
                            <Run FontWeight="Bold" Text="Hp10Rate Off: "/>
                            <Run Text="{Binding HP10RateOFF,StringFormat={}{0:0.00} µSv/h}" />
                            <Run FontWeight="Bold" Text=" On: "/>
                            <Run Text="{Binding HP10RateON,StringFormat={}{0:0.00} µSv/h}" />
                        </TextBlock>
                        <TextBlock  Grid.Row="3" Grid.Column="1"  >
                            <Run FontWeight="Bold" Text="Type : "/>
                            <Run Text="{Binding EPDRad}" />
                        </TextBlock>
                        <TextBlock  Grid.Row="3" Grid.Column="2"   >
                            <Run FontWeight="Bold" Text="Gain : "/>
                            <Run Text="{Binding FNGain_ANGainValue,StringFormat={}{0:0.00}}" />
                        </TextBlock>
                        <TextBlock  Grid.Row="3" Grid.Column="3"   >
                            <Run FontWeight="Bold" Text="Dose margin : "/>
                            <Run Text="{Binding MinWorkerDosisMargin,StringFormat={}{0:0.00}}" />
                        </TextBlock>
                    </Grid>
                    <StackPanel Grid.Row="4" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center"  >
                        <telerik:RadButton Name="TaskCancel" Content="Cancel" Click="TaskCancel_Click"   Width="300" Style="{DynamicResource OkCancelButton}" Margin="20,0,0,0"  />
                    </StackPanel>
                    <StackPanel Grid.Row="4" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center"  >
                        <telerik:RadButton Name="TaskOK" Content="OK" Width="300"   Click="TaskOK_Click" Style="{DynamicResource OkCancelButton}" IsEnabled="False"  />
                    </StackPanel>
                </Grid>
            </TabItem>
            <TabItem Name="tbEPD" FontSize="25"  >
                <Grid  DataContext="{Binding Mode=OneWay, Source={StaticResource getTaskListViewSource}}" >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="20" />
                        <RowDefinition Height="auto" />
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="0" Name="panelWait" VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Vertical"   >
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/Images/Mannetjet.png" Width="87" HorizontalAlignment="Left"/>
                            <TextBlock Text="Waiting for EPD" Margin="10,100,10,100" FontWeight="Bold"  >
                                <TextBlock.Foreground>
                                    <SolidColorBrush Color="{DynamicResource sckcP}"/>
                                </TextBlock.Foreground>
                            </TextBlock>
                        </StackPanel>
                        <Image Source="/Images/Mk2OnReader.jpg" Width="300" Margin="10,10,10,50"/>
                    </StackPanel>
                    <Grid Grid.Row="1" Name="panelDone"  HorizontalAlignment="Center" >
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="auto" />
                                <RowDefinition Height="auto" />
                                <RowDefinition Height="auto" />
                                <RowDefinition Height="auto" />
                                <RowDefinition Height="auto" />
                                <RowDefinition Height="auto" />
                                <RowDefinition Height="auto" />
                                <RowDefinition Height="auto" />
                                <RowDefinition Height="auto" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="auto" />
                                <ColumnDefinition Width="auto" />
                                <ColumnDefinition Width="auto" />
                            </Grid.ColumnDefinitions>

                            <TextBlock Grid.Row="0" Grid.Column="0" Text="Task" Style="{StaticResource tblIssuedLabel}"  />
                            <TextBlock Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2">
                                <Run Text="{Binding Task_Name,Mode=OneWay}" />
                                <Run Text=" (" />
                                <Run Text="{Binding ID_Task,Mode=OneWay}"  />
                                <Run Text=")" />
                            </TextBlock>

                            <TextBlock Grid.Row="1" Grid.Column="0" Text="Margin" Style="{StaticResource tblIssuedLabel}" TextAlignment="Right"/>
                            <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding MinWorkerDosisMargin,StringFormat={}{0:0.00}}" Style="{StaticResource tblIssuedValue}" />

                            <TextBlock Grid.Row="2" Grid.Column="1" Name="lbHP07" Text="HP07" Style="{DynamicResource sIssuedSubHeader}" />
                            <TextBlock Grid.Row="2" Grid.Column="2" Name="lbHP10" Text="HP10" Style="{DynamicResource sIssuedSubHeader}" />

                            <TextBlock Grid.Row="3" Grid.ColumnSpan="2" Grid.Column="1" Text="Doses (µSv)" Style="{DynamicResource sIssuedSubHeader}" TextAlignment="Center"/>

                            <TextBlock Grid.Row="4" Grid.Column="0" Text="Low alarm" Style="{StaticResource tblIssuedLabel}"/>
                            <TextBlock Grid.Row="4" Grid.Column="2" Text="{Binding Hp10Dose1,Mode=OneWay,StringFormat={}{0:0.00}}"  Style="{StaticResource tblIssuedValue}" />

                            <TextBlock Grid.Row="5" Grid.Column="0" Text="High alarm" Style="{StaticResource tblIssuedLabel}"/>
                            <TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding Hp07Dose,Mode=OneWay,StringFormat={}{0:0.00}}" Style="{StaticResource tblIssuedValue}"/>
                            <TextBlock Grid.Row="5" Grid.Column="2" Text="{Binding Hp10Dose2,Mode=OneWay,StringFormat={}{0:0.00}}" Style="{StaticResource tblIssuedValue}"/>

                            <TextBlock Grid.Row="6" Grid.ColumnSpan="2" Text="Rates (µSv/h)" Style="{DynamicResource sIssuedSubHeader}" Grid.Column="1" />
                            <TextBlock Grid.Row="7" Grid.Column="0" Text="Low alarm" Style="{StaticResource tblIssuedLabel}"/>
                            <TextBlock Grid.Row="7" Grid.Column="2" Text="{Binding HP10Rate1ON,Mode=OneWay,StringFormat={}{0:0.00}}"  Style="{StaticResource tblIssuedValue}" />

                            <TextBlock Grid.Row="8" Grid.Column="0" Text="High alarm" Style="{StaticResource tblIssuedLabel}"/>
                            <TextBlock Grid.Row="8" Grid.Column="1" Text="{Binding HP07RateON,Mode=OneWay,StringFormat={}{0:0.00}}" Style="{StaticResource tblIssuedValue}"/>
                            <TextBlock Grid.Row="8" Grid.Column="2" Text="{Binding HP10Rate2ON,Mode=OneWay,StringFormat={}{0:0.00}}" Style="{StaticResource tblIssuedValue}"/>


                        </Grid>
                    </Grid>
                    <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center">
                        <telerik:RadButton Name="bEpdCancel" Content="Cancel" Click="bClose_Click" Style="{DynamicResource OkCancelButton}" Margin="100,10,200,9.6" Height="Auto" />
                        <!--<telerik:RadButton Name="bEpdDone"  Background="LawnGreen"  Content="OK" Click="bClose_Click" Style="{DynamicResource OkCancelButton}"  Margin="100,10,200,10" />-->
                    </StackPanel>
                    <telerik:RadProgressBar Grid.Row="3" x:Name="pWaitEpd" Style="{StaticResource styleTTOProgessBar}"   />
                    <TextBlock Grid.Row="4" FontSize="25"  Name="statusEPD" Text="waiting" HorizontalAlignment="Center" TextAlignment="Center" />
                </Grid>
            </TabItem>
            <TabItem  Name="tbNotAllowed">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="300" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="100" />
                    </Grid.RowDefinitions>

                    <TextBlock Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center" FontSize="25" >
                <Run Text="No Access" />
                <Run Name="tReasonNoAccess" Text="" />
                <LineBreak/>

                    </TextBlock>
                    <telerik:RadButton Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24" Background="LawnGreen" Padding="10,10,10,10" Content="OK" Name="bNoAccessDone" Click="bClose_Click" Style="{DynamicResource OkCancelButton}">
                    </telerik:RadButton>
                </Grid>
            </TabItem>
        </TabControl>
    </DockPanel>
</Window>

