<commit_before>﻿<ListBox x:Class="Wox.ResultListBox"
         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:vm="clr-namespace:Wox.ViewModel"
         xmlns:converter="clr-namespace:Wox.Converters"
         mc:Ignorable="d" d:DesignWidth="100" d:DesignHeight="100"
         d:DataContext="{d:DesignInstance vm:ResultsViewModel}"
         MaxHeight="{Binding MaxHeight}"
         SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}"
         SelectedItem="{Binding SelectedItem, Mode=OneWayToSource}"
         HorizontalContentAlignment="Stretch" ItemsSource="{Binding Results}"
         Margin="{Binding Margin}"
         Visibility="{Binding Visbility}"
         Style="{DynamicResource BaseListboxStyle}" Focusable="False"
         KeyboardNavigation.DirectionalNavigation="Cycle" SelectionMode="Single"
         VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard"
         SelectionChanged="OnSelectionChanged"
         IsSynchronizedWithCurrentItem="True"
         PreviewMouseDown="ListBox_PreviewMouseDown">
    <!--IsSynchronizedWithCurrentItem: http://stackoverflow.com/a/7833798/2833083-->
    <ListBox.ItemTemplate>
        <DataTemplate>
            <Button>
                <Button.Template>
                    <ControlTemplate>
                        <ContentPresenter Content="{TemplateBinding Button.Content}" />
                    </ControlTemplate>
                </Button.Template>
                <Button.Content>
                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5"
                          Cursor="Hand" UseLayoutRounding="False">
                        <Grid.Resources>
                            <converter:HighlightTextConverter x:Key="HighlightTextConverter"/>
                            <converter:MultilineTextConverter x:Key="MultilineTextConverter"/>
                        </Grid.Resources>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="32" />
                            <ColumnDefinition />
                            <ColumnDefinition Width="0" />
                        </Grid.ColumnDefinitions>
                        <Image x:Name="imgIco" Width="32" Height="32" HorizontalAlignment="Left"
                               Source="{Binding Image.Value, IsAsync=True}" />
                        <Grid Margin="5 0 5 0" Grid.Column="1" HorizontalAlignment="Stretch">
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition Height="Auto" x:Name="SubTitleRowDefinition" />
                            </Grid.RowDefinitions>
                            <TextBlock Style="{DynamicResource ItemTitleStyle}" DockPanel.Dock="Left"
                                       VerticalAlignment="Center" ToolTip="{Binding Result.Title}" x:Name="Title">
                                <vm:ResultsViewModel.FormattedText>
                                    <MultiBinding Converter="{StaticResource HighlightTextConverter}" Mode="TwoWay">
                                        <Binding Path="Result.Title" Converter="{StaticResource MultilineTextConverter}" />
                                        <Binding Path="Result.TitleHighlightData" />
                                        <Binding RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBoxItem}}"
                                                 Path="IsSelected" />
                                    </MultiBinding>
                                </vm:ResultsViewModel.FormattedText>
                            </TextBlock>
                            <TextBlock Style="{DynamicResource ItemSubTitleStyle}" ToolTip="{Binding Result.SubTitle , Converter={StaticResource MultilineTextConverter}}"<commit_msg>add converter<commit_after>﻿<ListBox x:Class="Wox.ResultListBox"
         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:vm="clr-namespace:Wox.ViewModel"
         xmlns:converter="clr-namespace:Wox.Converters"
         mc:Ignorable="d" d:DesignWidth="100" d:DesignHeight="100"
         d:DataContext="{d:DesignInstance vm:ResultsViewModel}"
         MaxHeight="{Binding MaxHeight}"
         SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}"
         SelectedItem="{Binding SelectedItem, Mode=OneWayToSource}"
         HorizontalContentAlignment="Stretch" ItemsSource="{Binding Results}"
         Margin="{Binding Margin}"
         Visibility="{Binding Visbility}"
         Style="{DynamicResource BaseListboxStyle}" Focusable="False"
         KeyboardNavigation.DirectionalNavigation="Cycle" SelectionMode="Single"
         VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard"
         SelectionChanged="OnSelectionChanged"
         IsSynchronizedWithCurrentItem="True"
         PreviewMouseDown="ListBox_PreviewMouseDown">
    <!--IsSynchronizedWithCurrentItem: http://stackoverflow.com/a/7833798/2833083-->
    <ListBox.ItemTemplate>
        <DataTemplate>
            <Button>
                <Button.Template>
                    <ControlTemplate>
                        <ContentPresenter Content="{TemplateBinding Button.Content}" />
                    </ControlTemplate>
                </Button.Template>
                <Button.Content>
                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5"
                          Cursor="Hand" UseLayoutRounding="False">
                        <Grid.Resources>
                            <converter:HighlightTextConverter x:Key="HighlightTextConverter"/>
                            <converter:MultilineTextConverter x:Key="MultilineTextConverter"/>
                        </Grid.Resources>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="32" />
                            <ColumnDefinition />
                            <ColumnDefinition Width="0" />
                        </Grid.ColumnDefinitions>
                        <Image x:Name="imgIco" Width="32" Height="32" HorizontalAlignment="Left"
                               Source="{Binding Image.Value, IsAsync=True}" />
                        <Grid Margin="5 0 5 0" Grid.Column="1" HorizontalAlignment="Stretch">
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition Height="Auto" x:Name="SubTitleRowDefinition" />
                            </Grid.RowDefinitions>
                            <TextBlock Style="{DynamicResource ItemTitleStyle}" DockPanel.Dock="Left"
                                       VerticalAlignment="Center" ToolTip="{Binding Result.Title, Converter={StaticResource MultilineTextConverter}}" x:Name="Title">
                                <vm:ResultsViewModel.FormattedText>
                                    <MultiBinding Converter="{StaticResource HighlightTextConverter}" Mode="TwoWay">
                                        <Binding Path="Result.Title" Converter="{StaticResource MultilineTextConverter}" />
                                        <Binding Path="Result.TitleHighlightData" />
                                        <Binding RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBoxItem}}"
                                                 Path="IsSelected" />
                                    </MultiBinding>
                                </vm:ResultsViewModel.FormattedText>
                            </TextBlock>
                            <TextBlock Style="{DynamicResource ItemSubTitleStyle}" ToolTip="{Binding Result.SubTitle, Converter={StaticResource MultilineTextConverter}}"
{'fraction_non_alphanumeric': 0.10377358490566038, 'fraction_numerical': 0.01185292694726657, 'mean_word_length': 1.846471600688468, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2093238', 'n_tokens_mistral': 2061, 'n_tokens_neox': 1824, 'n_words': 252}