<commit_before>﻿<Window x:Class="TabControlDemo.MainWindow"
		x:Name="mainWindow"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:local="clr-namespace:TabControlDemo"
		xmlns:fa="http://schemas.fontawesome.io/icons/"
		Title="MainWindow"
		Height="300"
		Width="300"
		WindowStartupLocation="CenterScreen">

	<Window.CommandBindings>
		<CommandBinding Command="{x:Static local:TabCommands.Close}"
						Executed="TabClose" />
		<CommandBinding Command="{x:Static local:TabCommands.CloseAll}"
						Executed="TabCloseAll" />
		<CommandBinding Command="{x:Static local:TabCommands.CloseAllOthers}"
						Executed="TabCloseAllOthers" />
		<CommandBinding Command="{x:Static local:TabCommands.Open}"
						Executed="TabOpen" />
		<CommandBinding Command="{x:Static local:TabCommands.Tab1}"
						Executed="TabOpenTab1" />
		<CommandBinding Command="{x:Static local:TabCommands.Tab2}"
						Executed="TabOpenTab2" />
	</Window.CommandBindings>
	<Window.InputBindings>
		<KeyBinding Key="W"
					Modifiers="Control"
					Command="{x:Static local:TabCommands.Close}"
					CommandTarget="{Binding SelectedItem, ElementName=tabControl}"/>
	</Window.InputBindings>

	<Window.Resources>
		<!-- Reset default button style. -->
		<Style TargetType="Button">
			<Setter Property="Background"
					Value="Transparent" />
			<Setter Property="Foreground"
					Value="White" />
			<Setter Property="BorderBrush"
					Value="Transparent" />
			<Setter Property="BorderThickness"
					Value="0" />
		</Style>

		<Thickness x:Key="Tab_Border_Thickness">4</Thickness>
		<Thickness x:Key="Tab_Border_Thickness_Selected">4, 4, 4, 0</Thickness>

		<!-- Menu items to create new tab -->
		<CompositeCollection x:Key="TabNewMenuItems"
                             x:Shared="false">
			<MenuItem Header="Tab 1"
					  Command="{x:Static local:TabCommands.Tab1}"
				  CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
			</MenuItem>
			<MenuItem Header="Tab 2"
					  Command="{x:Static local:TabCommands.Tab2}"
					  CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
			</MenuItem>
		</CompositeCollection>

		<Style TargetType="TabControl">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="TabControl">
						<DockPanel>
							<!-- TabPanel -->
							<StackPanel DockPanel.Dock="Top"<commit_msg>Fix the problem that context menu is not showing up properly when window is first initialized.<commit_after>﻿<Window x:Class="TabControlDemo.MainWindow"
		x:Name="mainWindow"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:local="clr-namespace:TabControlDemo"
		xmlns:fa="http://schemas.fontawesome.io/icons/"
		Title="MainWindow"
		Height="300"
		Width="300"
		WindowStartupLocation="CenterScreen"
		FocusManager.FocusedElement="{Binding RelativeSource={RelativeSource Self}, Mode=OneTime}">

	<Window.CommandBindings>
		<CommandBinding Command="{x:Static local:TabCommands.Close}"
						Executed="TabClose" />
		<CommandBinding Command="{x:Static local:TabCommands.CloseAll}"
						Executed="TabCloseAll" />
		<CommandBinding Command="{x:Static local:TabCommands.CloseAllOthers}"
						Executed="TabCloseAllOthers" />
		<CommandBinding Command="{x:Static local:TabCommands.Open}"
						Executed="TabOpen" />
		<CommandBinding Command="{x:Static local:TabCommands.Tab1}"
						Executed="TabOpenTab1" />
		<CommandBinding Command="{x:Static local:TabCommands.Tab2}"
						Executed="TabOpenTab2" />
	</Window.CommandBindings>
	<Window.InputBindings>
		<KeyBinding Key="W"
					Modifiers="Control"
					Command="{x:Static local:TabCommands.Close}"
					CommandTarget="{Binding SelectedItem, ElementName=tabControl}"/>
	</Window.InputBindings>

	<Window.Resources>
		<!-- Reset default button style. -->
		<Style TargetType="Button">
			<Setter Property="Background"
					Value="Transparent" />
			<Setter Property="Foreground"
					Value="White" />
			<Setter Property="BorderBrush"
					Value="Transparent" />
			<Setter Property="BorderThickness"
					Value="0" />
		</Style>

		<Thickness x:Key="Tab_Border_Thickness">4</Thickness>
		<Thickness x:Key="Tab_Border_Thickness_Selected">4, 4, 4, 0</Thickness>

		<!-- Menu items to create new tab -->
		<CompositeCollection x:Key="TabNewMenuItems"
                             x:Shared="false">
			<MenuItem Header="Tab 1"
					  Command="{x:Static local:TabCommands.Tab1}"
					  CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
			</MenuItem>
			<MenuItem Header="Tab 2"
					  Command="{x:Static local:TabCommands.Tab2}"
					  CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
			</MenuItem>
		</CompositeCollection>

		<Style TargetType="TabControl">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="TabControl">
						<DockPanel>
							<!-- TabPanel -->
							<StackPanel DockPanel.Dock="Top"
{'fraction_non_alphanumeric': 0.14694844953584832, 'fraction_numerical': 0.011060635986569228, 'mean_word_length': 4.570957095709571, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '6175941', 'n_tokens_mistral': 1915, 'n_tokens_neox': 1524, 'n_words': 244}