<UserControl x:Class="JuliusSweetland.OptiKey.UI.Views.Management.PointingAndSelectingView"
             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:controls="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:enums="clr-namespace:JuliusSweetland.OptiKey.Enums"
             mc:Ignorable="d" 
             d:DesignHeight="400" d:DesignWidth="600">

    <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Auto">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
        
            <GroupBox Grid.Row="0" Header="Pointing">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" SharedSizeGroup="LabelColumn" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
            
                    <TextBlock Grid.Row="0" Grid.Column="0" Text="Source:" 
                                VerticalAlignment="Center" Margin="5" />
                    <ComboBox Grid.Row="0" Grid.Column="1" 
                                ItemsSource="{Binding PointsSources}"
                                DisplayMemberPath="Key"
                                SelectedValuePath="Value"
                                SelectedValue="{Binding PointsSource, Mode=TwoWay}" />
                      
                    <TextBlock Grid.Row="1" Grid.Column="0" Text="Mouse position sample interval (ms):" 
                                VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding PointsSource}" Value="{x:Static enums:PointsSources.MousePosition}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <controls:NumericUpDown Grid.Row="1" Grid.Column="1" TextAlignment="Left"
                                            Minimum="1" Interval="10" StringFormat="###,##0"
                                            Value="{Binding PointsMousePositionSampleIntervalInMs, Mode=TwoWay}">
                        <controls:NumericUpDown.Style>
                            <Style TargetType="{x:Type controls:NumericUpDown}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding PointsSource}" Value="{x:Static enums:PointsSources.MousePosition}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </controls:NumericUpDown.Style>
                    </controls:NumericUpDown>

                    <TextBlock Grid.Row="2" Grid.Column="0" Text="Time until point becomes irrelevent (ms):" 
                                VerticalAlignment="Center" Margin="5" />
                    <controls:NumericUpDown Grid.Row="2" Grid.Column="1" TextAlignment="Left"
                                            Minimum="1" Interval="10" StringFormat="###,##0"
                                            Value="{Binding PointTtlInMs, Mode=TwoWay}" />
                </Grid>
            </GroupBox>
        
            <GroupBox Grid.Row="1" Header="Selection">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" SharedSizeGroup="LabelColumn" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
            
                    <TextBlock Grid.Row="0" Grid.Column="0" Text="Key selection source:" 
                               VerticalAlignment="Center" Margin="5" />
                    <ComboBox Grid.Row="0" Grid.Column="1" 
                              ItemsSource="{Binding TriggerSources}"
                              DisplayMemberPath="Key"
                              SelectedValuePath="Value"
                              SelectedValue="{Binding KeySelectionTriggerSource, Mode=TwoWay}" />

                    <TextBlock Grid.Row="1" Grid.Column="0" Text="Key fixation time to lock-on (ms):" 
                               VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <controls:NumericUpDown Grid.Row="1" Grid.Column="1" TextAlignment="Left"
                                            Minimum="1" Interval="10" StringFormat="###,##0"
                                            Value="{Binding KeySelectionTriggerFixationLockOnTimeInMs, Mode=TwoWay}">
                        <controls:NumericUpDown.Style>
                            <Style TargetType="{x:Type controls:NumericUpDown}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </controls:NumericUpDown.Style>
                    </controls:NumericUpDown>

                    <TextBlock Grid.Row="2" Grid.Column="0" Text="Resuming an incomplete key fixation requires a new lock on:" 
                               VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <CheckBox Grid.Row="2" Grid.Column="1" 
                          VerticalAlignment="Center"
                          IsChecked="{Binding KeySelectionTriggerFixationResumeRequiresLockOn, Mode=TwoWay}" />
                    
                    <TextBlock Grid.Row="3" Grid.Column="0" Text="Key fixation time to complete (ms):" 
                               VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <controls:NumericUpDown Grid.Row="3" Grid.Column="1" TextAlignment="Left"
                                            Minimum="1" Interval="10" StringFormat="###,##0"
                                            Value="{Binding KeySelectionTriggerFixationCompleteTimeInMs, Mode=TwoWay}">
                        <controls:NumericUpDown.Style>
                            <Style TargetType="{x:Type controls:NumericUpDown}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </controls:NumericUpDown.Style>
                    </controls:NumericUpDown>

                    <TextBlock Grid.Row="4" Grid.Column="0" Text="Incomplete key fixation time to live (ms):" 
                               VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <controls:NumericUpDown Grid.Row="4" Grid.Column="1" TextAlignment="Left"
                                            Minimum="1" Interval="10" StringFormat="###,##0"
                                            Value="{Binding KeySelectionTriggerIncompleteFixationTtlInMs, Mode=TwoWay}">
                        <controls:NumericUpDown.Style>
                            <Style TargetType="{x:Type controls:NumericUpDown}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </controls:NumericUpDown.Style>
                    </controls:NumericUpDown>

                    <TextBlock Grid.Row="5" Grid.Column="0" Text="Key selection keyboard key:" 
                               VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.KeyboardKeyDownsUps}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <ComboBox Grid.Row="5" Grid.Column="1" 
                              ItemsSource="{Binding Keys}"
                              SelectedValue="{Binding KeySelectionTriggerKeyboardKeyDownUpKey, Mode=TwoWay}">
                        <ComboBox.Style>
                            <Style TargetType="{x:Type ComboBox}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.KeyboardKeyDownsUps}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </ComboBox.Style>
                    </ComboBox>

                    <TextBlock Grid.Row="6" Grid.Column="0" Text="Key selection mouse button:" 
                               VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.MouseButtonDownUps}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <ComboBox Grid.Row="6" Grid.Column="1" 
                              ItemsSource="{Binding MouseButtons}"
                              SelectedValue="{Binding KeySelectionTriggerMouseDownUpButton, Mode=TwoWay}">
                        <ComboBox.Style>
                            <Style TargetType="{x:Type ComboBox}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.MouseButtonDownUps}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </ComboBox.Style>
                    </ComboBox>
                    
                    <TextBlock Grid.Row="7" Grid.Column="0" Text="Point selection source:" 
                               VerticalAlignment="Center" Margin="5" />
                    <ComboBox Grid.Row="7" Grid.Column="1" 
                              ItemsSource="{Binding TriggerSources}"
                              DisplayMemberPath="Key"
                              SelectedValuePath="Value"
                              SelectedValue="{Binding PointSelectionTriggerSource, Mode=TwoWay}" />

                    <TextBlock Grid.Row="8" Grid.Column="0" Text="Point fixation time to lock-on (ms):" 
                               VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <controls:NumericUpDown Grid.Row="8" Grid.Column="1" TextAlignment="Left"
                                            Minimum="1" Interval="10" StringFormat="###,##0"
                                            Value="{Binding PointSelectionTriggerFixationLockOnTimeInMs, Mode=TwoWay}">
                        <controls:NumericUpDown.Style>
                            <Style TargetType="{x:Type controls:NumericUpDown}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </controls:NumericUpDown.Style>
                    </controls:NumericUpDown>

                    <TextBlock Grid.Row="9" Grid.Column="0" Text="Point fixation time to complete (ms):" 
                               VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <controls:NumericUpDown Grid.Row="9" Grid.Column="1" TextAlignment="Left"
                                            Minimum="1" Interval="10" StringFormat="###,##0"
                                            Value="{Binding PointSelectionTriggerFixationCompleteTimeInMs, Mode=TwoWay}">
                        <controls:NumericUpDown.Style>
                            <Style TargetType="{x:Type controls:NumericUpDown}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </controls:NumericUpDown.Style>
                    </controls:NumericUpDown>

                    <TextBlock Grid.Row="10" Grid.Column="0" Text="Point lock-on radius (pixels):" 
                               VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <controls:NumericUpDown Grid.Row="10" Grid.Column="1" TextAlignment="Left"
                                            Minimum="1" Interval="1" StringFormat="###,##0"
                                            Value="{Binding PointSelectionTriggerLockOnRadiusInPixels, Mode=TwoWay}">
                        <controls:NumericUpDown.Style>
                            <Style TargetType="{x:Type controls:NumericUpDown}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </controls:NumericUpDown.Style>
                    </controls:NumericUpDown>
                    
                    <TextBlock Grid.Row="11" Grid.Column="0" Text="Point fixation radius (pixels):" 
                               VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <controls:NumericUpDown Grid.Row="11" Grid.Column="1" TextAlignment="Left"
                                            Minimum="1" Interval="1" StringFormat="###,##0"
                                            Value="{Binding PointSelectionTriggerFixationRadiusInPixels, Mode=TwoWay}">
                        <controls:NumericUpDown.Style>
                            <Style TargetType="{x:Type controls:NumericUpDown}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </controls:NumericUpDown.Style>
                    </controls:NumericUpDown>
            
                    <TextBlock Grid.Row="12" Grid.Column="0" Text="Point selection keyboard key:" 
                               VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.KeyboardKeyDownsUps}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <ComboBox Grid.Row="12" Grid.Column="1" 
                              ItemsSource="{Binding Keys}"
                              SelectedValue="{Binding PointSelectionTriggerKeyboardKeyDownUpKey, Mode=TwoWay}">
                        <ComboBox.Style>
                            <Style TargetType="{x:Type ComboBox}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.KeyboardKeyDownsUps}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </ComboBox.Style>
                    </ComboBox>
            
                    <TextBlock Grid.Row="13" Grid.Column="0" Text="Point selection mouse button:" 
                               VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.MouseButtonDownUps}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <ComboBox Grid.Row="13" Grid.Column="1" 
                              ItemsSource="{Binding MouseButtons}"
                              SelectedValue="{Binding PointSelectionTriggerMouseDownUpButton, Mode=TwoWay}">
                        <ComboBox.Style>
                            <Style TargetType="{x:Type ComboBox}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.MouseButtonDownUps}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </ComboBox.Style>
                    </ComboBox>

                    <TextBlock Grid.Row="14" Grid.Column="0" Text="Selection progress indicator behaviour:" 
                               VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <ComboBox Grid.Row="14" Grid.Column="1" 
                              ItemsSource="{Binding ProgressIndicatorBehaviours}"
                              DisplayMemberPath="Key"
                              SelectedValuePath="Value"
                              SelectedValue="{Binding ProgressIndicatorBehaviour, Mode=TwoWay}">
                        <ComboBox.Style>
                            <Style TargetType="{x:Type ComboBox}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Visible" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </ComboBox.Style>
                    </ComboBox>

                    <TextBlock Grid.Row="15" Grid.Column="0" Text="Selection progress indicator start size (%):" 
                               VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}" />
                                            <Condition Binding="{Binding ProgressIndicatorBehaviour}" Value="{x:Static enums:ProgressIndicatorBehaviours.Grow}" />
                                        </MultiDataTrigger.Conditions>
                                        <Setter Property="Visibility" Value="Visible" />
                                    </MultiDataTrigger>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}" />
                                            <Condition Binding="{Binding ProgressIndicatorBehaviour}" Value="{x:Static enums:ProgressIndicatorBehaviours.Shrink}" />
                                        </MultiDataTrigger.Conditions>
                                        <Setter Property="Visibility" Value="Visible" />
                                    </MultiDataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <controls:NumericUpDown Grid.Row="15" Grid.Column="1" 
                                            TextAlignment="Left"
                                            Minimum="0" Maximum="100" Interval="1"
                                            Value="{Binding ProgressIndicatorResizeStartProportion, Mode=TwoWay}">
                        <controls:NumericUpDown.Style>
                            <Style TargetType="{x:Type controls:NumericUpDown}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}" />
                                            <Condition Binding="{Binding ProgressIndicatorBehaviour}" Value="{x:Static enums:ProgressIndicatorBehaviours.Grow}" />
                                        </MultiDataTrigger.Conditions>
                                        <Setter Property="Visibility" Value="Visible" />
                                    </MultiDataTrigger>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}" />
                                            <Condition Binding="{Binding ProgressIndicatorBehaviour}" Value="{x:Static enums:ProgressIndicatorBehaviours.Shrink}" />
                                        </MultiDataTrigger.Conditions>
                                        <Setter Property="Visibility" Value="Visible" />
                                    </MultiDataTrigger>
                                </Style.Triggers>
                            </Style>
                        </controls:NumericUpDown.Style>
                    </controls:NumericUpDown>

                    <TextBlock Grid.Row="16" Grid.Column="0" Text="Selection progress indicator end size (%):" 
                               VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}" />
                                            <Condition Binding="{Binding ProgressIndicatorBehaviour}" Value="{x:Static enums:ProgressIndicatorBehaviours.Grow}" />
                                        </MultiDataTrigger.Conditions>
                                        <Setter Property="Visibility" Value="Visible" />
                                    </MultiDataTrigger>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}" />
                                            <Condition Binding="{Binding ProgressIndicatorBehaviour}" Value="{x:Static enums:ProgressIndicatorBehaviours.Shrink}" />
                                        </MultiDataTrigger.Conditions>
                                        <Setter Property="Visibility" Value="Visible" />
                                    </MultiDataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>
                    </TextBlock>
                    <controls:NumericUpDown Grid.Row="16" Grid.Column="1" 
                                            TextAlignment="Left"
                                            Minimum="0" Maximum="100" Interval="1"
                                            Value="{Binding ProgressIndicatorResizeEndProportion, Mode=TwoWay}">
                        <controls:NumericUpDown.Style>
                            <Style TargetType="{x:Type controls:NumericUpDown}">
                                <Setter Property="Visibility" Value="Collapsed" />
                                <Style.Triggers>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}" />
                                            <Condition Binding="{Binding ProgressIndicatorBehaviour}" Value="{x:Static enums:ProgressIndicatorBehaviours.Grow}" />
                                        </MultiDataTrigger.Conditions>
                                        <Setter Property="Visibility" Value="Visible" />
                                    </MultiDataTrigger>
                                    <MultiDataTrigger>
                                        <MultiDataTrigger.Conditions>
                                            <Condition Binding="{Binding PointSelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}" />
                                            <Condition Binding="{Binding ProgressIndicatorBehaviour}" Value="{x:Static enums:ProgressIndicatorBehaviours.Shrink}" />
                                        </MultiDataTrigger.Conditions>
                                        <Setter Property="Visibility" Value="Visible" />
                                    </MultiDataTrigger>
                                </Style.Triggers>
                            </Style>
                        </controls:NumericUpDown.Style>
                    </controls:NumericUpDown>
                </Grid>
            </GroupBox>
        
            <GroupBox Grid.Row="2" Header="Multi-key Selection">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" SharedSizeGroup="LabelColumn" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
            
                    <TextBlock Grid.Row="0" Grid.Column="0" Text="Stop signal:" 
                               VerticalAlignment="Center" Margin="5">
                        <TextBlock.Style>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Visibility" Value="Visible" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Collapsed" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </TextBlock.Style>    
                    </TextBlock>
                    <ComboBox Grid.Row="0" Grid.Column="1" 
                              ItemsSource="{Binding TriggerStopSignals}"
                              DisplayMemberPath="Key"
                              SelectedValuePath="Value"
                              SelectedValue="{Binding MultiKeySelectionTriggerStopSignal, Mode=TwoWay}">
                        <ComboBox.Style>
                            <Style TargetType="{x:Type ComboBox}">
                                <Setter Property="Visibility" Value="Visible" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding KeySelectionTriggerSource}" Value="{x:Static enums:TriggerSources.Fixations}">
                                        <Setter Property="Visibility" Value="Collapsed" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </ComboBox.Style>
                    </ComboBox>
                
                    <TextBlock Grid.Row="1" Grid.Column="0" Text="Minimum dwell time on a key to include in capture (ms):" 
                               VerticalAlignment="Center" Margin="5"/>
                    <controls:NumericUpDown Grid.Row="1" Grid.Column="1" TextAlignment="Left"
                                            Minimum="1" Interval="10" StringFormat="###,##0"
                                            Value="{Binding MultiKeySelectionFixationMinDwellTimeInMs, Mode=TwoWay}"/>

                    <TextBlock Grid.Row="2" Grid.Column="0" Text="Capture timeout (ms):" 
                               VerticalAlignment="Center" Margin="5"/>
                    <controls:NumericUpDown Grid.Row="2" Grid.Column="1" TextAlignment="Left"
                                            Minimum="1" Interval="10" StringFormat="###,##0"
                                            Value="{Binding MultiKeySelectionMaxDurationInMs, Mode=TwoWay}"/>
                </Grid>
            </GroupBox>
        </Grid>
    </ScrollViewer>
</UserControl>
