<wpf:ThemableWindow x:Class="InABox.Wpf.DictionaryRadioEdit"
                    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:wpf="clr-namespace:InABox.Wpf"
                    xmlns:wpf1="clr-namespace:InABox.WPF"
                    mc:Ignorable="d"
                    Title="{Binding Title}" 
                    SizeToContent="WidthAndHeight" 
                    MinWidth="300" 
                    MinHeight="120"
                    WindowStartupLocation="CenterScreen">
    
    <wpf:ThemableWindow.DataContext>
        <wpf:DictionaryRadioEditViewModel x:Name="ViewModel" />
    </wpf:ThemableWindow.DataContext>
    <wpf:ThemableWindow.Resources>
        <wpf1:StringToVisibilityConverter x:Key="StringToVisibilityConverter" />
        <wpf1:ObjectToBooleanConverter x:Key="ObjectToBooleanConverter" />
    </wpf:ThemableWindow.Resources>
    
    <DockPanel Margin="5">

        <Label 
            DockPanel.Dock="Top"
            Margin="5" 
            HorizontalContentAlignment="Center" 
            Content="{Binding Description}"
               Visibility="{Binding Description, Converter={StaticResource StringToVisibilityConverter}}" />
        
        <StackPanel DockPanel.Dock="Bottom" HorizontalAlignment="Center" Orientation="Horizontal" Margin="5">
            <Button 
                MinWidth="80" 
                MinHeight="30" 
                Padding="10,5" 
                Margin="0,0,2.5,0" 
                Content="OK" 
                Click="OK_Click" 
                IsEnabled="{Binding List.Selected, Converter={StaticResource ObjectToBooleanConverter}}" />
            <Button 
                MinWidth="80" 
                MinHeight="30" 
                Padding="10,5" 
                Margin="2.5,0,0,0" 
                Content="Cancel" 
                Click="Cancel_Click" />
        </StackPanel>
        
        <Border 
            DockPanel.Dock="Top"
            Margin="5" 
            BorderBrush="Gray"
            BorderThickness="0.75"
            Padding="10"
            CornerRadius="5">
            
            <ItemsControl ItemsSource="{Binding List.Items}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate DataType="{x:Type wpf:DictionaryRadioItem}">
                        <DockPanel>
                            <CheckBox DockPanel.Dock="Left" IsChecked="{Binding Checked}"  Padding="10" VerticalContentAlignment="Center" />
                            <Label DockPanel.Dock="Right" Content="{Binding Value}" Padding="0,10,10,10" VerticalContentAlignment="Center" />
                        </DockPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
            
        </Border>
        
    </DockPanel>
    
</wpf:ThemableWindow>