<Window x:Class="GenericWpfApp.View.ImpedanceCheckWindow"
        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:GenericWpfApp.View"
        mc:Ignorable="d"
        Title="Impedance Check"
        WindowStyle="None"
        MouseLeftButtonDown="Window_MouseLeftButtonDown"
        Height="300"
        Width="400">
    <WindowChrome.WindowChrome>
        <WindowChrome GlassFrameThickness="0" CornerRadius="0" CaptionHeight="0"/>
    </WindowChrome.WindowChrome>
    <Window.Resources>
        <!-- Style for the close button -->
        <Style x:Key="TitleBarCloseButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Border x:Name="bdr_main" BorderThickness="1" BorderBrush="Transparent" Background="Transparent">
                            <ContentPresenter x:Name="bdr_main2" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Content"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="bdr_main" Property="Background" Value="#e94856"/>
                                <Setter TargetName="bdr_main" Property="BorderBrush" Value="#ba1245"/>
                                <Setter TargetName="bdr_main2"  Property="Content">
                                    <Setter.Value>
                                        <Image Source="/Resources/Images/Title_Bar_Buttons/close_white.png" Width="20" Height="20" />
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter TargetName="bdr_main" Property="Background" Value="#ff829a"/>
                                <Setter TargetName="bdr_main" Property="BorderBrush" Value="#e94856"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>

    <!-- Main Grid that contains everything -->
    <Grid Background="#f4f6fd">
        <Grid.RowDefinitions>
            <RowDefinition Height="30px"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Title bar which has the app icon, app title, minimize button, maximize button and close button -->
        <Grid>
            <WrapPanel HorizontalAlignment="left" VerticalAlignment="Center">
                <Image x:Name="imgAppIcon" Source="/Resources/Images/missile.png" Width="20" Height="20" Margin="10,0,10,0"/>
                <TextBlock x:Name="txtBlockAppTitle">Impedance Check</TextBlock>
            </WrapPanel>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="0">
                <Button Style="{StaticResource TitleBarCloseButtonStyle}" x:Name="btnClose" Width="44" Background="Transparent" BorderBrush="Transparent" Click="btnClose_Click">
                    <Image Source="/Resources/Images/Title_Bar_Buttons/close_black.png" Width="20" Height="20"/>
                </Button>
            </StackPanel>
        </Grid>

        <ListView Grid.Row="1" x:Name="lvImpedanceCheck" ItemsSource="{Binding _listviewImpedanceDatatems}" Margin="15,5,15,15">
            <ListView.ItemContainerStyle>
                <Style TargetType="ListViewItem">
                    <Setter Property="Focusable" Value="false"/>
                </Style>
            </ListView.ItemContainerStyle>
            <ListView.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Image Source="{Binding PassFailImagePath}" Width="15" Height="15" />
                        <TextBlock Text="{Binding Description}" Margin="5,0,0,0"/>
                    </StackPanel>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

    </Grid>
</Window>
