<commit_before>﻿<UserControl x:Class="Profiler.ThreadView"
             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:Profiler="clr-namespace:Profiler"
             xmlns:Profiler_Data="clr-namespace:Profiler.Data"
             xmlns:DX="clr-namespace:Profiler.DirectX"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" Height="Auto">

    <UserControl.Resources>
        <Style x:Key="LabelUnderscoreStyle" BasedOn="{StaticResource {x:Type Label}}" TargetType="Label">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Label">
                    <Border>
                        <ContentPresenter
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            RecognizesAccessKey="False" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        </Style>
    </UserControl.Resources>
    <Grid Height="Auto" Name="panel">
        <Grid.RowDefinitions>
            <RowDefinition Height="280*" />
            <RowDefinition Height="20*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <StackPanel Margin="0,-30,2,0" HorizontalAlignment="Right" x:Name="ThreadToolsPanel" Grid.Column="1" VerticalAlignment="Top" Orientation="Horizontal">
            <ToggleButton x:Name="ShowSyncWorkButton" ToolTip="Show Work" Width="{StaticResource DefaultButtonSize}" Height="{StaticResource DefaultButtonSize}" Margin="0,0,1,0" Padding="-5" Click="ShowSyncWorkButton_Click">
                <ContentControl Style="{StaticResource appbar_suitcase}" />
            </ToggleButton>
            <ToggleButton x:Name="ShowCallstacksButton" ToolTip="Show Callstacks" Width="{StaticResource DefaultButtonSize}" Height="{StaticResource DefaultButtonSize}" Margin="0,0,4,0" Padding="-8" Click="ShowCallstacksButton_Click">
                <ContentControl Style="{StaticResource appbar_camera_flash}" />
            </ToggleButton>
            <Profiler:SearchBox x:Name="search" Width="200" />
        </StackPanel>
        <DX:DirectXCanvas x:Name="surface" Height="Auto" Grid.Row="0" Grid.Column="1" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">
        </DX:DirectXCanvas>
        <Popup x:Name="SurfacePopup" StaysOpen="False" Placement="Mouse" PopupAnimation="Fade" IsEnabled="False" Focusable="False" IsHitTestVisible="False" AllowsTransparency="True">
            <Border BorderThickness="1" Background="{StaticResource BroContentBackground}" BorderBrush="{StaticResource AccentColorBrush}">
                <ItemsControl ItemsSource="{Binding}" Margin="0">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Vertical"/>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.Resources>
                        <DataTemplate DataType="{x:Type Profiler_Data:EventNode}">
                            <Grid Margin="0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <Rectangle Grid.Column="0" Margin="4,0,0,0" Width="16" Height="16" Fill="{Binding Brush}" Stroke="Black" StrokeThickness="1" RadiusX="2" RadiusY="2" />
                                <Label Grid.Column="1" Margin="0" Content="{Binding Name, Mode=OneTime}" FontWeight="Bold" />
                                <Label Grid.Column="2" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Content="{Binding Duration, Mode=OneTime}" ContentStringFormat="{}{0:0.###} ms" FontWeight="Bold" />
                            </Grid>
                        </DataTemplate>
                        <DataTemplate DataType="{x:Type Profiler_Data:WaitInterval}">
                            <Grid Margin="0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <ContentControl Style="{StaticResource appbar_timer_pause}" Margin="-3,-6,-6,-6" Width="32" Height="32" />
                                <Label Grid.Column="1" Content="{Binding ReasonText, Mode=OneTime}" ContentStringFormat="{}Cursor: {0}" Margin="-2,0,0,0" />
                                <Label Grid.Column="2" Margin="0" Content="{Binding Duration, Mode=OneTime}" ContentStringFormat="{}{0:0.###} ms" />
                            </Grid>
                        </DataTemplate>
                        <DataTemplate DataType="{x:Type Profiler_Data:NodeWaitIntervalList}">
                            <Expander Header="Synchronization" IsExpanded="True" FontWeight="Bold">
                                <DataGrid ItemsSource="{Binding}"  CanUserAddRows="False" GridLinesVisibility="None" IsReadOnly="True" BorderThickness="0" AutoGenerateColumns="False" FontWeight="Normal">
                                    <DataGrid.Columns>
                                        <DataGridTextColumn Header="Reason" Binding="{Binding Reason}" />
                                        <DataGridTextColumn Header="Time(ms)" Binding="{Binding Duration, StringFormat={}{0:0.###}ms}" />
                                        <DataGridTextColumn Header="Time(%)" Binding="{Binding Percent, StringFormat={}{0:0.#}%}" />
                                        <DataGridTextColumn Header="Count" Binding="{Binding Count}" />
                                    </DataGrid.Columns>
                                </DataGrid>
                            </Expander>
                        </DataTemplate>
                        <DataTemplate DataType="{x:Type Profiler_Data:Callstack}">
                            <Expander Header="Callstack" IsExpanded="True" FontWeight="Bold">
                                <DataGrid AutoGenerateColumns="False" ItemsSource="{Binding}" CanUserAddRows="False" HeadersVisibility="None" GridLinesVisibility="None" IsReadOnly="True" BorderThickness="0" FontWeight="Normal">
                                    <DataGrid.Columns><commit_msg>Fix missing line in ThreadView<commit_after>﻿<UserControl x:Class="Profiler.ThreadView"
             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:Profiler="clr-namespace:Profiler"
             xmlns:Profiler_Data="clr-namespace:Profiler.Data"
             xmlns:DX="clr-namespace:Profiler.DirectX"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" Height="Auto">

    <UserControl.Resources>
        <Style x:Key="LabelUnderscoreStyle" BasedOn="{StaticResource {x:Type Label}}" TargetType="Label">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Label">
                    <Border>
                        <ContentPresenter
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            RecognizesAccessKey="False" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        </Style>
    </UserControl.Resources>
    <Grid Height="Auto" Name="panel">
        <Grid.RowDefinitions>
            <RowDefinition Height="280*" />
            <RowDefinition Height="20*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <StackPanel Margin="0,-30,2,0" HorizontalAlignment="Right" x:Name="ThreadToolsPanel" Grid.Column="1" VerticalAlignment="Top" Orientation="Horizontal">
            <ToggleButton x:Name="ShowSyncWorkButton" ToolTip="Show Work" Width="{StaticResource DefaultButtonSize}" Height="{StaticResource DefaultButtonSize}" Margin="0,0,1,0" Padding="-5" Click="ShowSyncWorkButton_Click">
                <ContentControl Style="{StaticResource appbar_suitcase}" />
            </ToggleButton>
            <ToggleButton x:Name="ShowCallstacksButton" ToolTip="Show Callstacks" Width="{StaticResource DefaultButtonSize}" Height="{StaticResource DefaultButtonSize}" Margin="0,0,4,0" Padding="-8" Click="ShowCallstacksButton_Click">
                <ContentControl Style="{StaticResource appbar_camera_flash}" />
            </ToggleButton>
            <Profiler:SearchBox x:Name="search" Width="200" />
        </StackPanel>
        <DX:DirectXCanvas x:Name="surface" Height="Auto" Grid.Row="0" Grid.Column="1" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">
        </DX:DirectXCanvas>
        <Popup x:Name="SurfacePopup" StaysOpen="False" Placement="Mouse" PopupAnimation="Fade" IsEnabled="False" Focusable="False" IsHitTestVisible="False" AllowsTransparency="True">
            <Border BorderThickness="1" Background="{StaticResource BroContentBackground}" BorderBrush="{StaticResource AccentColorBrush}">
                <ItemsControl ItemsSource="{Binding}" Margin="0">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Vertical"/>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.Resources>
                        <DataTemplate DataType="{x:Type Profiler_Data:EventNode}">
                            <Grid Margin="0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    <ColumnDefinition Width="*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <Rectangle Grid.Column="0" Margin="4,0,0,0" Width="16" Height="16" Fill="{Binding Brush}" Stroke="Black" StrokeThickness="1" RadiusX="2" RadiusY="2" />
                                <Label Grid.Column="1" Margin="0" Content="{Binding Name, Mode=OneTime}" FontWeight="Bold" Style="{StaticResource LabelUnderscoreStyle}" />
                                <Label Grid.Column="2" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Content="{Binding Duration, Mode=OneTime}" ContentStringFormat="{}{0:0.###} ms" FontWeight="Bold" />
                            </Grid>
                        </DataTemplate>
                        <DataTemplate DataType="{x:Type Profiler_Data:WaitInterval}">
                            <Grid Margin="0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <ContentControl Style="{StaticResource appbar_timer_pause}" Margin="-3,-6,-6,-6" Width="32" Height="32" />
                                <Label Grid.Column="1" Content="{Binding ReasonText, Mode=OneTime}" ContentStringFormat="{}Cursor: {0}" Margin="-2,0,0,0" />
                                <Label Grid.Column="2" Margin="0" Content="{Binding Duration, Mode=OneTime}" ContentStringFormat="{}{0:0.###} ms" />
                            </Grid>
                        </DataTemplate>
                        <DataTemplate DataType="{x:Type Profiler_Data:NodeWaitIntervalList}">
                            <Expander Header="Synchronization" IsExpanded="True" FontWeight="Bold">
                                <DataGrid ItemsSource="{Binding}"  CanUserAddRows="False" GridLinesVisibility="None" IsReadOnly="True" BorderThickness="0" AutoGenerateColumns="False" FontWeight="Normal">
                                    <DataGrid.Columns>
                                        <DataGridTextColumn Header="Reason" Binding="{Binding Reason}" />
                                        <DataGridTextColumn Header="Time(ms)" Binding="{Binding Duration, StringFormat={}{0:0.###}ms}" />
                                        <DataGridTextColumn Header="Time(%)" Binding="{Binding Percent, StringFormat={}{0:0.#}%}" />
                                        <DataGridTextColumn Header="Count" Binding="{Binding Count}" />
                                    </DataGrid.Columns>
                                </DataGrid>
                            </Expander>
                        </DataTemplate>
                        <DataTemplate DataType="{x:Type Profiler_Data:Callstack}">
                            <Expander Header="Callstack" IsExpanded="True" FontWeight="Bold">
                                <DataGrid AutoGenerateColumns="False" ItemsSource="{Binding}" CanUserAddRows="False" HeadersVisibility="None" GridLinesVisibility="None" IsReadOnly="True" BorderThickness="0" FontWeight="Normal">
                                    <DataGrid.Columns>
{'fraction_non_alphanumeric': 0.12514782608695652, 'fraction_numerical': 0.013078260869565218, 'mean_word_length': 1.9708617482951023, 'pattern_counts': {'":': 0, '<': 175, '<?xml version=': 0, '>': 175, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5431246', 'n_tokens_mistral': 3698, 'n_tokens_neox': 3366, 'n_words': 531}