<UserControl x:Class="Valg.EVA.Skanning.Sample.Startup.Ballot.BallotMetadataControl"
             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:Valg.EVA.Skanning.Sample.Startup.Ballot"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="300"
             d:DataContext="{d:DesignInstance d:Type=local:BallotControlViewModel}">
    <Grid>
        <StackPanel Orientation="Vertical">
            <TextBlock Text="{Binding SampleLanguageString.BallotMetadata_ManuallyVerified, Mode=OneWay}"
                           FontWeight="Bold"
                           Visibility="{Binding BallotOverview.ManuallyVerified, Converter={StaticResource BooleanToVisibilityConverter}}">
            </TextBlock>
            <TextBlock Text="{Binding SampleLanguageString.BallotMetadata_MachineReadOnly, Mode=OneWay}"
                       Visibility="{Binding BallotOverview.AutomaticallyVerified, Converter={StaticResource BooleanToVisibilityConverter}}">
            </TextBlock>
            <TextBlock Text="{Binding BallotOverview.RejectionReasonText}" Foreground="Red" Visibility="{Binding BallotOverview.ProposedRejected, Converter={StaticResource BooleanToVisibilityHiddenConverter}}"/>
            <TextBlock 
                Text= "{Binding SampleLanguageString.BallotMetadata_Affiliation, Mode=OneWay}"
                FontWeight="Bold"
                Visibility="{Binding BallotOverview.IsAffiliationKnown, Converter={StaticResource BooleanToVisibilityHiddenConverter}}"></TextBlock>
            <TextBlock Text="{Binding BallotOverview.AffiliationId}"></TextBlock>
            <StackPanel Visibility="{Binding BallotOverview.HasPersonVotes, Converter={StaticResource BooleanToVisibilityConverter}}">
                <TextBlock Text="{Binding SampleLanguageString.BallotMetadata_PersonVotes, Mode=OneWay}" FontWeight="Bold"/>
                <DataGrid  
                    ItemsSource="{Binding BallotOverview.PersonVotes}" 
                    AutoGenerateColumns="False" 
                    IsReadOnly="True">
                    <DataGrid.Columns >
                        <DataGridTextColumn Header="Nummer" 
                                            Binding="{Binding CandidateNumber}" />
                        <DataGridTextColumn Header="Navn" 
                                            Binding="{Binding CandidateName}" />
                    </DataGrid.Columns>
                </DataGrid>
            </StackPanel>
            <StackPanel Visibility="{Binding BallotOverview.HasRenumberings, Converter={StaticResource BooleanToVisibilityConverter}}">
                <TextBlock Text="{Binding SampleLanguageString.BallotMetadata_Renumberings, Mode=OneWay}"  FontWeight="Bold"/>
                <DataGrid  
                        ItemsSource="{Binding BallotOverview.Renumberings}" 
                        AutoGenerateColumns="False" 
                        IsReadOnly="True">
                    <DataGrid.Columns >
                        <DataGridTextColumn Header="Nummer"  Binding="{Binding OriginalCandidateNumber }" />
                        <DataGridTextColumn Header="Rettet til" Binding="{Binding NewCandidateNumber }" />
                        <DataGridTextColumn Header="Navn"  Binding="{Binding CandidateName}" />
                    </DataGrid.Columns>
                </DataGrid>
            </StackPanel>
            <StackPanel Visibility="{Binding BallotOverview.HasStrikeouts, Converter={StaticResource BooleanToVisibilityConverter}}">
                <TextBlock Text="{Binding SampleLanguageString.BallotMetadata_Strikeouts}" FontWeight="Bold"/>
                <DataGrid  
                        ItemsSource="{Binding BallotOverview.Strikeouts}" 
                        AutoGenerateColumns="False" 
                        IsReadOnly="True">
                    <DataGrid.Columns >
                        <DataGridTextColumn Header="Nummer" Binding="{Binding CandidateNumber}" />
                        <DataGridTextColumn Header="Navn" Binding="{Binding CandidateName}" />
                    </DataGrid.Columns>
                </DataGrid>
            </StackPanel>
            <StackPanel Visibility="{Binding BallotOverview.HasWriteInVotes, Converter={StaticResource BooleanToVisibilityConverter}}">
                <TextBlock Text="{Binding SampleLanguageString.BallotMetadata_Writeins}" FontWeight="Bold"/>
                <DataGrid  
                    ItemsSource="{Binding BallotOverview.WriteInVotes}" 
                    AutoGenerateColumns="False" 
                    IsReadOnly="True">
                    <DataGrid.Columns >
                        <DataGridTextColumn Header="Navn" Binding="{Binding CandidateName}" />
                        <DataGridTextColumn Header="Parti" Binding="{Binding AffiliationId}" />
                    </DataGrid.Columns>
                </DataGrid>
            </StackPanel>
        </StackPanel>
    </Grid>
</UserControl>

