<Window x:Class="Valg.EVA.Skanning.Scan.Presentation.Sample.SelectCountingView"
        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:commands1="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.Commands;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        xmlns:sample="clr-namespace:Valg.EVA.Skanning.Scan.Presentation.Sample"
        xmlns:read="clr-namespace:Valg.EVA.Skanning.ServicesModel.ServiceContracts.Box.Read;assembly=Valg.EVA.Skanning.ServicesModel"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        mc:Ignorable="d" 
        d:DesignHeight="300" 
        d:DataContext="{d:DesignInstance d:Type=sample:SelectCountingViewModel}"
        Style="{DynamicResource PopUpWindowAction}"
        WindowStartupLocation="CenterOwner">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Valg.EVA.Skanning.Assets;component/ResourceDictionaries/ResourceLibrary.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Window.InputBindings>
        <KeyBinding Key="Escape" 
                    Command="{x:Static commands1:WellKnownSystemCommands.CloseCommand}"
                    CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
    </Window.InputBindings>
<StackPanel Margin="30">
    <TextBlock Margin="0,0,0,5" Style="{StaticResource TextBlockNormal}" Text="{Binding ModalDialogDescriptionText}" />
        <ItemsControl ItemsSource="{Binding BoxCountings}">
        <ItemsControl.ItemTemplate>
            <DataTemplate DataType="{x:Type sample:CountingMetaData}">
                <Button Margin="0,0,0,15" Style="{StaticResource LinkButtonMedium}" 
                        Command="{Binding Path=DataContext.SelectedCountingCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type sample:SelectCountingView}} }"
                        CommandParameter="{Binding }"
                        Content="{Binding ButtonText}"
                        Click="CloseWindow"/>
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>
    </StackPanel>
</Window>

