<commit_before>﻿<UserControl x:Class="Microsoft.VisualStudio.LanguageServices.ValueTracking.ValueTrackingTree"
             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.LanguageServices.ValueTracking"
             xmlns:utils="clr-namespace:Microsoft.VisualStudio.LanguageServices.Utilities"
             mc:Ignorable="d" 
             xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0"
             d:DesignHeight="450" d:DesignWidth="800"
             x:Name="control">

    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <ProgressBar
            Grid.Row="0"
            Grid.ColumnSpan="3"
            Grid.Column="0"
            IsIndeterminate="True"
            Panel.ZIndex="10000"
            Minimum="0"
            Maximum="100"
            Height="2"
            Visibility="{Binding IsLoading, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}"
            Foreground="{DynamicResource {x:Static vs:ProgressBarColors.IndicatorFillBrushKey}}"
            Background="{DynamicResource {x:Static vs:ProgressBarColors.BackgroundBrushKey}}" />

        <TreeView 
            Grid.Row="1" 
            Grid.Column="0" 
            x:Name="ValueTrackingTreeView" 
            ItemsSource="{Binding Roots}" 
            SelectedItemChanged="ValueTrackingTree_SelectedItemChanged" 
            BorderThickness="0" 
            PreviewKeyDown="ValueTrackingTree_PreviewKeyDown" 
            PreviewMouseDoubleClick="ValueTrackingTree_MouseDoubleClickPreview"
            AutomationProperties.Name="{Binding AutomationName, Mode=OneWay}">
            <TreeView.ItemContainerStyle>
                <Style TargetType="{x:Type TreeViewItem}">
                    <Setter Property="IsExpanded" Value="{Binding IsNodeExpanded, Mode=TwoWay}" />
                    <Setter Property="IsSelected" Value="{Binding IsNodeSelected, Mode=TwoWay}" />
                    <Setter Property="AutomationProperties.Name" Value="{Binding AutomationName, Mode=OneWay}" />
                </Style>
            </TreeView.ItemContainerStyle>
            <TreeView.Resources>
                <HierarchicalDataTemplate DataType="{x:Type local:TreeItemViewModel}" ItemsSource="{Binding ChildItems}">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="{Binding GlyphImage}" />
                        <utils:BindableTextBlock InlineCollection="{Binding Inlines}" Margin="0 0 5 0" />
                    </StackPanel>
                </HierarchicalDataTemplate>
                <DataTemplate DataType="{x:Type local:EmptyTreeViewItem}">
                </DataTemplate>
                <DataTemplate DataType="{x:Type local:ComputingTreeViewItem}">
                    <StackPanel Orientation="Horizontal">
                        <vs:ProgressControl Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <vs:ProgressControl.RenderTransform>
                                <ScaleTransform ScaleX="0.50" ScaleY="0.50" />
                            </vs:ProgressControl.RenderTransform>
                        </vs:ProgressControl>
                        <TextBlock Text="{Binding Text}" Margin="0 0 5 0" />
                    </StackPanel>
                </DataTemplate>
            </TreeView.Resources>
        </TreeView>

        <GridSplitter 
            Grid.Column="1" 
            Grid.Row="1"
            ResizeBehavior="PreviousAndNext"
            ShowsPreview="true"
            Width="5" />

        <ScrollViewer Grid.Column="2" Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" HorizontalContentAlignment="Left" HorizontalAlignment="Left">
            <Grid Visibility="{Binding ShowDetails, Converter={StaticResource BooleanToVisibilityConverter}}" HorizontalAlignment="Left">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Label Content="File" Grid.Row="0" Grid.Column="0" x:Name="FileNameLabel" />
                <Label Grid.Row="0" Grid.Column="1" Content="{Binding SelectedItemFile}" x:Name="FileName" AutomationProperties.LabeledBy="{Binding ElementName=FileNameLabel}" VerticalAlignment="Center" />

                <Label Content="Line" Grid.Row="1" Grid.Column="0" x:Name="LineNumberLabel" />
                <Label Grid.Row="1" Grid.Column="1" Content="{Binding SelectedItemLine}" x:Name="LineNumber" AutomationProperties.LabeledBy="{Binding ElementName=LineNumberLabel}" VerticalAlignment="Center" />
            </Grid>
        </ScrollViewer>
    </Grid>
</UserControl>
<commit_msg>Fix WPF issue with indeterminate progress bar (#61254)<commit_after>﻿<UserControl x:Class="Microsoft.VisualStudio.LanguageServices.ValueTracking.ValueTrackingTree"
             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.LanguageServices.ValueTracking"
             xmlns:utils="clr-namespace:Microsoft.VisualStudio.LanguageServices.Utilities"
             mc:Ignorable="d" 
             xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0"
             d:DesignHeight="450" d:DesignWidth="800"
             x:Name="control">

    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <ProgressBar
            Grid.Row="0"
            Grid.ColumnSpan="3"
            Grid.Column="0"
            IsIndeterminate="{Binding RelativeSource={RelativeSource Self}, Path=IsVisible}"
            Panel.ZIndex="10000"
            Minimum="0"
            Maximum="100"
            Height="2"
            Visibility="{Binding IsLoading, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}"
            Foreground="{DynamicResource {x:Static vs:ProgressBarColors.IndicatorFillBrushKey}}"
            Background="{DynamicResource {x:Static vs:ProgressBarColors.BackgroundBrushKey}}" />

        <TreeView 
            Grid.Row="1" 
            Grid.Column="0" 
            x:Name="ValueTrackingTreeView" 
            ItemsSource="{Binding Roots}" 
            SelectedItemChanged="ValueTrackingTree_SelectedItemChanged" 
            BorderThickness="0" 
            PreviewKeyDown="ValueTrackingTree_PreviewKeyDown" 
            PreviewMouseDoubleClick="ValueTrackingTree_MouseDoubleClickPreview"
            AutomationProperties.Name="{Binding AutomationName, Mode=OneWay}">
            <TreeView.ItemContainerStyle>
                <Style TargetType="{x:Type TreeViewItem}">
                    <Setter Property="IsExpanded" Value="{Binding IsNodeExpanded, Mode=TwoWay}" />
                    <Setter Property="IsSelected" Value="{Binding IsNodeSelected, Mode=TwoWay}" />
                    <Setter Property="AutomationProperties.Name" Value="{Binding AutomationName, Mode=OneWay}" />
                </Style>
            </TreeView.ItemContainerStyle>
            <TreeView.Resources>
                <HierarchicalDataTemplate DataType="{x:Type local:TreeItemViewModel}" ItemsSource="{Binding ChildItems}">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="{Binding GlyphImage}" />
                        <utils:BindableTextBlock InlineCollection="{Binding Inlines}" Margin="0 0 5 0" />
                    </StackPanel>
                </HierarchicalDataTemplate>
                <DataTemplate DataType="{x:Type local:EmptyTreeViewItem}">
                </DataTemplate>
                <DataTemplate DataType="{x:Type local:ComputingTreeViewItem}">
                    <StackPanel Orientation="Horizontal">
                        <vs:ProgressControl Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <vs:ProgressControl.RenderTransform>
                                <ScaleTransform ScaleX="0.50" ScaleY="0.50" />
                            </vs:ProgressControl.RenderTransform>
                        </vs:ProgressControl>
                        <TextBlock Text="{Binding Text}" Margin="0 0 5 0" />
                    </StackPanel>
                </DataTemplate>
            </TreeView.Resources>
        </TreeView>

        <GridSplitter 
            Grid.Column="1" 
            Grid.Row="1"
            ResizeBehavior="PreviousAndNext"
            ShowsPreview="true"
            Width="5" />

        <ScrollViewer Grid.Column="2" Grid.Row="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" HorizontalContentAlignment="Left" HorizontalAlignment="Left">
            <Grid Visibility="{Binding ShowDetails, Converter={StaticResource BooleanToVisibilityConverter}}" HorizontalAlignment="Left">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Label Content="File" Grid.Row="0" Grid.Column="0" x:Name="FileNameLabel" />
                <Label Grid.Row="0" Grid.Column="1" Content="{Binding SelectedItemFile}" x:Name="FileName" AutomationProperties.LabeledBy="{Binding ElementName=FileNameLabel}" VerticalAlignment="Center" />

                <Label Content="Line" Grid.Row="1" Grid.Column="0" x:Name="LineNumberLabel" />
                <Label Grid.Row="1" Grid.Column="1" Content="{Binding SelectedItemLine}" x:Name="LineNumber" AutomationProperties.LabeledBy="{Binding ElementName=LineNumberLabel}" VerticalAlignment="Center" />
            </Grid>
        </ScrollViewer>
    </Grid>
</UserControl>

{'fraction_non_alphanumeric': 0.11587646802957807, 'fraction_numerical': 0.012440191387559809, 'mean_word_length': 2.296816747920849, 'pattern_counts': {'":': 0, '<': 129, '<?xml version=': 0, '>': 129, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5650013', 'n_tokens_mistral': 3108, 'n_tokens_neox': 2764, 'n_words': 404}