<UserControl x:Class="Microsoft.VisualStudio.FSharp.UIResources.LanguageServicePerformanceOptionControl"
             x:ClassModifier="internal"
             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:Microsoft.VisualStudio.FSharp.UIResources"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="400">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="OptionPageStyle.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <ScrollViewer VerticalScrollBarVisibility="Auto">
            <StackPanel>
                <GroupBox Header="{x:Static local:Strings.Project_Performance}">
                    <StackPanel>
                        <CheckBox x:Name="enableInMemoryCrossProjectReferences"
                                  IsChecked="{Binding EnableInMemoryCrossProjectReferences}"
                                  Content="{x:Static local:Strings.Enable_in_memory_cross_project_references}"
                                  ToolTip="{x:Static local:Strings.Tooltip_in_memory_cross_project_references}"/>
                        <CheckBox x:Name="enablePartialTypeChecking"
                                  IsChecked="{Binding EnablePartialTypeChecking}"
                                  Content="{x:Static local:Strings.Enable_partial_type_checking}" />
                        <CheckBox x:Name="enableSyntaxTreeCache"
                                  IsChecked="{Binding UseSyntaxTreeCache}"
                                  Content="{x:Static local:Strings.Use_syntax_tree_cache}" />
                    </StackPanel>
                </GroupBox>
                <GroupBox Header="{x:Static local:Strings.IntelliSense_Performance}">
                    <StackPanel>
                        <CheckBox x:Name="enableStaleIntelliSenseResults"
                                  IsChecked="{Binding AllowStaleCompletionResults}"
                                  Content="{x:Static local:Strings.Enable_Stale_IntelliSense_Results}"/>
                        <Grid IsEnabled="{Binding IsChecked, ElementName=enableStaleIntelliSenseResults}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="auto"/>
                                <ColumnDefinition Width="70" />
                            </Grid.ColumnDefinitions>
                                <Label Grid.Column="0"
                                   x:Name="timeUntilStaleIntelliSenseLabel"
                                   Content="{x:Static local:Strings.Time_until_stale_completion}"
                                   Margin="15 0 0 0"/>
                                <TextBox Grid.Column="1"
                                     HorizontalContentAlignment="Right" 
                                     VerticalContentAlignment="Center">
                                    <TextBox.Text>
                                        <Binding UpdateSourceTrigger="PropertyChanged" Path="TimeUntilStaleCompletion">
                                            <Binding.ValidationRules>
                                                <local:IntegerRangeValidationRule Min="0" Max="10000"/>
                                                <!-- If people truly want more than 10 seconds before stale results come in, they can open an issue on VisualFSharp. -->
                                            </Binding.ValidationRules>
                                        </Binding>
                                    </TextBox.Text>
                                </TextBox>
                        </Grid>
                    </StackPanel>
                </GroupBox>
                <GroupBox Header="{x:Static local:Strings.Parallelization}">
                    <StackPanel>
                        <CheckBox x:Name="enableParallelReferenceResolution"
                                  IsChecked="{Binding EnableParallelReferenceResolution}"
                                  Content="{x:Static local:Strings.Enable_Parallel_Reference_Resolution}"/>
                    </StackPanel>
                </GroupBox>
                <GroupBox Header="{x:Static local:Strings.Find_References_Performance}">
                    <StackPanel>
                        <CheckBox x:Name="enableFastFindReferencesAndRename"
                                  IsChecked="{Binding EnableFastFindReferencesAndRename}"
                                  Content="{x:Static local:Strings.Enable_Fast_Find_References}"/>
                    </StackPanel>
                </GroupBox>
                <GroupBox Header="{x:Static local:Strings.Language_Service_Settings}">
                    <StackPanel>
                        <CheckBox x:Name="keepAllBackgroundResolutions"
                                  IsChecked="{Binding KeepAllBackgroundResolutions}"
                                  Content="{x:Static local:Strings.Keep_All_Background_Resolutions}"/>
                        <CheckBox x:Name="keepAllBackgroundSymbolUses"
                                  IsChecked="{Binding KeepAllBackgroundSymbolUses}"
                                  Content="{x:Static local:Strings.Keep_All_Background_Symbol_Uses}"/>
                        <CheckBox x:Name="enableBackgroundItemKeyStoreAndSemanticClassification"
                                  IsChecked="{Binding EnableBackgroundItemKeyStoreAndSemanticClassification}"
                                  Content="{x:Static local:Strings.Enable_Background_ItemKeyStore_And_Semantic_Classification}"/>
                        <CheckBox x:Name="captureIdentifiersWhenParsing"
                                  IsChecked="{Binding CaptureIdentifiersWhenParsing}"
                                  Content="{x:Static local:Strings.Capture_Identifiers_When_Parsing}"/>                        
                    </StackPanel>
                </GroupBox>

            </StackPanel>
        </ScrollViewer>
    </Grid>
</UserControl>