<UserControl x:Class="CustomDialogs.SelectFromListScene" IsTabStop="False" Loaded="UserControl_Loaded" Height="380" Width="400" 
             Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" 
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml">
    <Border Padding="5">
        <Grid Margin="5,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="3*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBlock Text="{c1:SchedulerLoc Key=SelectFromListScene:selected, DefaultValue=Selected:}" Margin="0,2,0,2" VerticalAlignment="Center" />
            <TextBox Grid.Row="1" IsReadOnly="True" IsTabStop="False" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" Padding="2" x:Name="selectedValues" />
            <Label Grid.Row="2" Content="{c1:SchedulerLoc Key=SelectFromListScene:available, DefaultValue=A_vailable:}" Target="{Binding ElementName=newItemText}" VerticalAlignment="Center" Padding="2" Margin="0,5,0,2" />
            <Grid Grid.Row="3">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <TextBox x:Name="newItemText" TabIndex="5" HorizontalAlignment="Stretch" Margin="0,2,0,2" VerticalAlignment="Center" Padding="2" />
                <ListBox TabIndex="0" x:Name="sourceListBox" Grid.Row="1" VerticalAlignment="Stretch" Grid.RowSpan="2" IsTabStop="False" Margin="0,2,0,2">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <CheckBox Content="{Binding}" Loaded="SourceItemSelectedCB_Loaded" Checked="SourceItemSelectedCB_Checked" GotFocus="SourceItemSelectedCB_GotFocus" Unchecked="SourceItemSelectedCB_Unchecked">
                                <CheckBox.Style>
                                    <Style TargetType="{x:Type CheckBox}">
                                        <Setter Property="Foreground" Value="{Binding Foreground, ElementName=newItemText}" />
                                        <Style.Triggers>
                                            <Trigger Property="IsFocused" Value="true">
                                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
                                                <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
                                            </Trigger>
                                        </Style.Triggers>
                                    </Style>
                                </CheckBox.Style>
                            </CheckBox>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                    <ListBox.ItemContainerStyle>
                        <Style TargetType="ListBoxItem">
                            <Setter Property="IsTabStop" Value="False" />
                            <Setter Property="Focusable" Value="False" />
                            <Setter Property="Padding" Value="2,1,1,1" />
                        </Style>
                    </ListBox.ItemContainerStyle>
                </ListBox>
                <Button x:Name="addButton" TabIndex="6" Click="addButton_Click" Grid.Row="0" Grid.Column="1" Padding="2" MinWidth="70" Margin="10,2,0,2" VerticalAlignment="Top" AccessKeyManager.AccessKeyPressed="accessKeyPressed" Content="{c1:SchedulerLoc Key=SelectFromListScene:btnAdd_Text, DefaultValue=_Add}" IsEnabled="{Binding Text, ElementName=newItemText,       Converter={x:Static c1:IsNotEmptyOrSpaceStringConverter.Default}}" />
                <Button Name="deleteButton" TabIndex="1" VerticalAlignment="Top" AccessKeyManager.AccessKeyPressed="accessKeyPressed" Content="{c1:SchedulerLoc Key=SelectFromListScene:btnRemove_Text, DefaultValue=_Delete}" Padding="2" MinWidth="70" Margin="10,2,0,2" Click="deleteButton_Click" Grid.Row="1" Grid.Column="1" />
                <Button Name="resetButton" TabIndex="2" VerticalAlignment="Top" AccessKeyManager.AccessKeyPressed="accessKeyPressed" Content="{c1:SchedulerLoc Key=SelectFromListScene:btnReset_Text, DefaultValue=_Reset}" Padding="2" MinWidth="70" Margin="10,2,0,2" Click="resetButton_Click" Grid.Row="2" Grid.Column="1" />
            </Grid>
			<Border Margin="-10,10,-10,-5" Grid.Row="4" Padding="0,0,10,5" Background="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" BorderThickness="0,1,0,0" Height="41">
	            <DockPanel LastChildFill="false" HorizontalAlignment="Right" Margin="0,5,0,0">
	                <Button Name="okButton" Click="okButton_Click" TabIndex="3" IsDefault="True" Padding="2" MinWidth="70" Margin="10,2,0,2" DockPanel.Dock="Left" Content="{c1:SchedulerLoc Key=SelectFromListScene:btnOk_Text, DefaultValue=_Ok}" />
                    <Button Name="cancelButton" Click="cancelButton_Click" TabIndex="4" DockPanel.Dock="Left" Padding="2" MinWidth="70" Margin="10,2,0,2" Content="{c1:SchedulerLoc Key=SelectFromListScene:btnCancel_Text, DefaultValue=_Cancel}" IsCancel="True" />
                </DockPanel>
			</Border>	
        </Grid>
    </Border>
</UserControl>