<commit_before>﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:l="clr-namespace:Playground.Controls">
    <!--
    固定列のGridViewHeaderRowPresenterとGridViewRowPresenterに設定されるStyle
    ScrollViewerのスクロールと連動してMarginを変更することによって絶対位置が変わらないようにする
    -->
    <Style x:Key="_gvex_frozencol_style_" TargetType="FrameworkElement">
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="Margin">
            <Setter.Value>
                <Binding Path="FrozenColumnsOffset" Mode="OneWay"
                         RelativeSource="{RelativeSource AncestorType=l:GridViewEx}"
                         Converter="{x:Static l:Converters.DoubleToThickness}"
                         ConverterParameter="1,0,0,0" />
            </Setter.Value>
        </Setter>
        <Setter Property="Width">
            <Setter.Value>
                <Binding Path="FrozenColumnsTotalWidth" Mode="OneWay"
                         RelativeSource="{RelativeSource AncestorType=l:GridViewEx}" />
            </Setter.Value>
        </Setter>
    </Style>

    <!--
    スクロール可能列のGridViewHeaderRowPresenterとGridViewRowPresenterに設定されるStyle
    ScrollViewerのHorizontalOffsetが0の時に固定列の右側に接する位置にくるようにMarginを設定する
    また、固定列の領域上に描画が重ならないようにClip Rectangleを設定する
    -->
    <Style x:Key="_gvex_normalcol_style_" TargetType="FrameworkElement">
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="Margin">
            <Setter.Value>
                <Binding Path="FrozenColumnsTotalWidth" Mode="OneWay"
                         RelativeSource="{RelativeSource AncestorType=l:GridViewEx}"
                         Converter="{x:Static l:Converters.DoubleToThickness}"
                         ConverterParameter="1,0,0,0" />
            </Setter.Value>
        </Setter>
        <Setter Property="Clip">
            <Setter.Value>
                <RectangleGeometry>
                    <RectangleGeometry.Rect>
                        <MultiBinding Converter="{x:Static l:Converters.DoublesToRect}">
                            <Binding Path="FrozenColumnsOffset" Mode="OneWay"
                                     RelativeSource="{RelativeSource AncestorType=l:GridViewEx}" />
                            <Binding Source="0" />
                            <Binding Path="ActualWidth" Mode="OneWay"
                                     RelativeSource="{RelativeSource AncestorType=FrameworkElement}" />
                            <Binding Path="ActualHeight" Mode="OneWay"
                                     RelativeSource="{RelativeSource AncestorType=FrameworkElement}" />
                        </MultiBinding>
                    </RectangleGeometry.Rect>
                </RectangleGeometry>
            </Setter.Value>
        </Setter>
    </Style>

    <!--
    ListBoxItemに適用されるStyle
    -->
    <Style x:Key="_gvex_item_style_" TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
        <Setter Property="MinHeight" Value="{Binding MinRowHeight, RelativeSource={RelativeSource AncestorType=l:GridViewEx}}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Grid Background="{TemplateBinding Background}">
                        <GridViewRowPresenter
                            Style="{StaticResource _gvex_normalcol_style_}"
                            Columns="{Binding NormalColumns, 
                                              RelativeSource={RelativeSource AncestorType=l:GridViewEx}}" />

                        <Border BorderThickness="0,0,1,0" BorderBrush="{x:Static SystemColors.ControlDarkBrush}"
                                Style="{StaticResource _gvex_frozencol_style_}">
                            <GridViewRowPresenter
                                Columns="{Binding FrozenColumns, 
                                                  RelativeSource={RelativeSource AncestorType=l:GridViewEx}}" />
                        </Border>


                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Selector.IsSelected" Value="True">
                            <Setter Property="Control.Background">
                                <Setter.Value>
                                    <DynamicResource ResourceKey="{x:Static SystemColors.HighlightBrushKey}" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="TextElement.Foreground">
                                <Setter.Value>
                                    <DynamicResource ResourceKey="{x:Static SystemColors.HighlightTextBrushKey}" />
                                </Setter.Value>
                            </Setter><commit_msg>Trivial fix<commit_after>﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:l="clr-namespace:Playground.Controls">
    <!--
    固定列のGridViewHeaderRowPresenterとGridViewRowPresenterに設定されるStyle
    ScrollViewerのスクロールと連動してMarginを変更することによって絶対位置が変わらないようにする
    -->
    <Style x:Key="_gvex_frozencol_style_" TargetType="FrameworkElement">
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="Margin">
            <Setter.Value>
                <Binding Path="FrozenColumnsOffset" Mode="OneWay"
                         RelativeSource="{RelativeSource AncestorType=l:GridViewEx}"
                         Converter="{x:Static l:Converters.DoubleToThickness}"
                         ConverterParameter="1,0,0,0" />
            </Setter.Value>
        </Setter>
    </Style>

    <!--
    スクロール可能列のGridViewHeaderRowPresenterとGridViewRowPresenterに設定されるStyle
    ScrollViewerのHorizontalOffsetが0の時に固定列の右側に接する位置にくるようにMarginを設定する
    また、固定列の領域上に描画が重ならないようにClip Rectangleを設定する
    -->
    <Style x:Key="_gvex_normalcol_style_" TargetType="FrameworkElement">
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="Margin">
            <Setter.Value>
                <Binding Path="FrozenColumnsTotalWidth" Mode="OneWay"
                         RelativeSource="{RelativeSource AncestorType=l:GridViewEx}"
                         Converter="{x:Static l:Converters.DoubleToThickness}"
                         ConverterParameter="1,0,0,0" />
            </Setter.Value>
        </Setter>
        <Setter Property="Clip">
            <Setter.Value>
                <RectangleGeometry>
                    <RectangleGeometry.Rect>
                        <MultiBinding Converter="{x:Static l:Converters.DoublesToRect}">
                            <Binding Path="FrozenColumnsOffset" Mode="OneWay"
                                     RelativeSource="{RelativeSource AncestorType=l:GridViewEx}" />
                            <Binding Source="0" />
                            <Binding Path="ActualWidth" Mode="OneWay"
                                     RelativeSource="{RelativeSource AncestorType=FrameworkElement}" />
                            <Binding Path="ActualHeight" Mode="OneWay"
                                     RelativeSource="{RelativeSource AncestorType=FrameworkElement}" />
                        </MultiBinding>
                    </RectangleGeometry.Rect>
                </RectangleGeometry>
            </Setter.Value>
        </Setter>
    </Style>

    <!--
    ListBoxItemに適用されるStyle
    -->
    <Style x:Key="_gvex_item_style_" TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
        <Setter Property="MinHeight" Value="{Binding MinRowHeight, Mode=OneWay, RelativeSource={RelativeSource AncestorType=l:GridViewEx}}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Grid Background="{TemplateBinding Background}">
                        <GridViewRowPresenter
                            Style="{StaticResource _gvex_normalcol_style_}"
                            Columns="{Binding NormalColumns, 
                                              RelativeSource={RelativeSource AncestorType=l:GridViewEx}}" />

                        <Border BorderThickness="0,0,1,0" BorderBrush="{x:Static SystemColors.ControlDarkBrush}"
                                Style="{StaticResource _gvex_frozencol_style_}"
                                Width="{Binding FrozenColumnsTotalWidth, Mode=OneWay,
                                                RelativeSource={RelativeSource AncestorType=l:GridViewEx}}" />

                        <GridViewRowPresenter
                                Columns="{Binding FrozenColumns, 
                                                  RelativeSource={RelativeSource AncestorType=l:GridViewEx}}"
                                Style="{StaticResource _gvex_frozencol_style_}" />

                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Selector.IsSelected" Value="True">
                            <Setter Property="Control.Background">
                                <Setter.Value>
                                    <DynamicResource ResourceKey="{x:Static SystemColors.HighlightBrushKey}" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="TextElement.Foreground">
                                <Setter.Value>
                                    <DynamicResource ResourceKey="{x:Static SystemColors.HighlightTextBrushKey}" />
                                </Setter.Value>
                            </Setter>
{'fraction_non_alphanumeric': 0.09795794581479984, 'fraction_numerical': 0.004448038819247877, 'mean_word_length': 1.6473106770136474, 'pattern_counts': {'":': 0, '<': 121, '<?xml version=': 0, '>': 121, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5444849', 'n_tokens_mistral': 2703, 'n_tokens_neox': 2379, 'n_words': 299}