<commit_before>﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    xmlns:Converters="clr-namespace:SoundBoard.ViewModel.Converters"
	xmlns:helpers="clr-namespace:SoundBoard.Helpers"
	xmlns:p="clr-namespace:SoundBoard.Properties"
	xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
    xmlns:dragDrop="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"
	xmlns:viewModel="clr-namespace:SoundBoard.ViewModel"
    xmlns:resx="clr-namespace:SoundBoard.Properties"
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    x:Name="window"
    mc:Ignorable="d" x:Class="SoundBoard.View.MainWindow"
	Title="Acillatem Sound Board"
	Height="450.042"
	Width="{Binding Width, Mode=TwoWay, Source={x:Static resx:Settings.Default}}"
	MinWidth="600"
	MinHeight="250"
	Icon="Radvisual-Holographic-My-music.ico"
    WindowStartupLocation="CenterScreen">
    <Window.Resources>
        <ResourceDictionary>
        	<helpers:TimeSpanToDoubleSecondsConverter x:Key="TimeSpanToDoubleSecondsConverter"/>
			<Style x:Key="ListViewItem" TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource {x:Type ListViewItem}}">
				<Setter Property="Height" Value="32"/>
			</Style>
			<helpers:DoubleToGridLengthConverter x:Key="DoubleToGridLengthConverter"/>
            <viewModel:MainWindowViewModel x:Key="MainWindowViewModelDataSource" d:IsDataSource="True"/>
            <Converters:TimeSpanToVisibilityConverter x:Key="TimeSpanToVisibilityConverter"/>
        	<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
        	<Converters:BooleanToOpacityConverter x:Key="BooleanToOpacityConverter"/>
            <DataTemplate x:Key="SoundBoardTemplate">
            	<StackPanel>
            		<TextBlock Text="{Binding Name}" />
            	</StackPanel>
            </DataTemplate>
			<DataTemplate x:Key="SoundColumnNameTemplate">
				<DockPanel>
					<Image VerticalAlignment="Center" Height="24" Width="24" Source="appbar.warning.circle.png" ToolTip="{Binding ErrorInfo.ErrorMessage}" Stretch="Fill" Visibility="{Binding ErrorInfo.HasError, Converter={StaticResource BooleanToVisibilityConverter}}">
						<Image.Effect>
							<DropShadowEffect/>
						</Image.Effect>
					</Image>

					<Label x:Name="textBlock" Content="{Binding Name}" ToolTip="{Binding FileName}">
						<i:Interaction.Triggers>
							<i:EventTrigger EventName="MouseDoubleClick">
								<i:InvokeCommandAction Command="{Binding Commands.ActivateSingleSoundCommand, Mode=OneWay, Source={StaticResource MainWindowViewModelDataSource}}" CommandParameter="{Binding DataContext, ElementName=textBlock}"/>
							</i:EventTrigger>
						</i:Interaction.Triggers>
					</Label>
				</DockPanel>
			</DataTemplate>
            <DataTemplate x:Key="ActiveSoundColumnNameTemplate">
                <DockPanel>
                    <Image Source="appbar.clock.png" Height="17" Width="17"  Visibility="{Binding Delay, Converter={StaticResource TimeSpanToVisibilityConverter}}" />
					<Label x:Name="Delay" Grid.Column="1" Content="{Binding Delay.TotalSeconds}" Visibility="{Binding Delay, Converter={StaticResource TimeSpanToVisibilityConverter}}" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="0,0,10,0" ContentStringFormat="s" />
                    <Label x:Name="textBlock" Content="{Binding Name}" ToolTip="{Binding FileName}">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="MouseDoubleClick">
                                <i:InvokeCommandAction Command="{Binding Commands.DeactivateSingleSoundCommand, Mode=OneWay, Source={StaticResource MainWindowViewModelDataSource}}" CommandParameter="{Binding DataContext, ElementName=textBlock}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </Label>
                </DockPanel>
            </DataTemplate>
            <System:Double x:Key="IsLoopedColumnWidth">NaN</System:Double>
			<DataTemplate x:Key="SoundColumnIsLoopedTemplate">
				<CheckBox HorizontalAlignment="Center" IsChecked="{Binding IsLooped, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
			</DataTemplate>

			<DataTemplate x:Key="SoundColumnVolumeTemplate">
				<Slider x:Name="slider" Width="75"
					Value="{Binding VolumeInPercent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
					AutoToolTipPlacement="BottomRight" Maximum="100" LargeChange="10" SmallChange="1"
					VerticalAlignment="Center" ToolTip="Volume" />
			</DataTemplate>

			<DataTemplate x:Key="SoundColumnDelayTemplate">
                <xctk:DoubleUpDown Minimum="0" Value="{Binding Delay, Converter={StaticResource TimeSpanToDoubleSecondsConverter}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsManipulationEnabled="True" ParsingNumberStyle="AllowDecimalPoint" Background="Transparent" BorderBrush="{DynamicResource NormalBorderBrush}" Foreground="{DynamicResource TextBrush}"/>
			</DataTemplate>
			<DataTemplate x:Key="ActiveSoundTemplate">
				<Grid>
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="Auto" />
						<ColumnDefinition Width="Auto" />
						<ColumnDefinition Width="250" />
						<ColumnDefinition Width="100" />
						<ColumnDefinition Width="100" />
					</Grid.ColumnDefinitions>
					<Image Height="24" Width="24" Source="appbar.clock.png" Visibility="{Binding Delay, Converter={StaticResource TimeSpanToVisibilityConverter}}">
						<Image.Effect>
							<DropShadowEffect/>
						</Image.Effect>
					</Image>
					<Label x:Name="Delay" Grid.Column="1" Content="{Binding Delay}" Visibility="{Binding Delay, Converter={StaticResource TimeSpanToVisibilityConverter}}" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="0,0,10,0" />
					<Label x:Name="Name" Content="{Binding Name}" ToolTip="{Binding FileName}" VerticalAlignment="Center" Focusable="True" Grid.Column="2" >
						<i:Interaction.Triggers>
							<i:EventTrigger EventName="MouseDoubleClick">
								<i:InvokeCommandAction Command="{Binding Commands.DeactivateSingleSoundCommand, Mode=OneWay, Source={StaticResource MainWindowViewModelDataSource}}" CommandParameter="{Binding DataContext, ElementName=Name}"/>
							</i:EventTrigger>
						</i:Interaction.Triggers>
					</Label>
					<Image x:Name="IsLooped" Height="24" Width="24" Grid.Column="3" OpacityMask="Black" Source="appbar.loop.png">
						<Image.Style>
							<Style>
								<Style.Triggers>
									<DataTrigger Binding="{Binding IsLooped}" Value="True">
										<Setter Property="UIElement.Effect">
											<Setter.Value>
												<DropShadowEffect Color="Blue" ShadowDepth="0" />
											</Setter.Value>
										</Setter>
									</DataTrigger>
									
								</Style.Triggers>
							</Style>
						</Image.Style>
						<i:Interaction.Triggers>
							<i:EventTrigger EventName="MouseLeftButtonUp">
								<i:InvokeCommandAction Command="{Binding Commands.ToggleSoundIsLoopedCommand, Mode=OneWay, Source={StaticResource MainWindowViewModelDataSource}}" CommandParameter="{Binding DataContext, ElementName=IsLooped}"/>
							</i:EventTrigger>
						</i:Interaction.Triggers>
					</Image>
					<Slider x:Name="Volume"
						Value="{Binding VolumeInPercent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
						AutoToolTipPlacement="BottomRight" Maximum="100" LargeChange="10" SmallChange="1"
						Grid.Column="4" VerticalAlignment="Center" ToolTip="Volume" />
				</Grid>
            </DataTemplate>
            <helpers:ListViewStretchedColumnWidthConverter x:Key="ListViewActualWidthToRemainingColumnWidthConverter" />
        </ResourceDictionary>
    </Window.Resources>
	<i:Interaction.Triggers>
		<i:EventTrigger EventName="Closing">
			<i:InvokeCommandAction Command="{Binding Commands.ShutdownAppCommand, Mode=OneWay, Source={StaticResource MainWindowViewModelDataSource}}"/>
		</i:EventTrigger>
	</i:Interaction.Triggers>
	<Grid x:Name="WindowGrid" DataContext="{Binding Source={StaticResource MainWindowViewModelDataSource}}">
		<Grid.RowDefinitions>
			<RowDefinition Height="{Binding SoundBoardSoundsHeight, Converter={StaticResource DoubleToGridLengthConverter}, Mode=TwoWay, Source={x:Static resx:Settings.Default}, UpdateSourceTrigger=PropertyChanged}" />
			<RowDefinition Height="10"/>
			<RowDefinition />
		</Grid.RowDefinitions>
		<GroupBox x:Name="gbSoundBoards"
			Grid.ColumnSpan="2" Grid.Row="0">
			<GroupBox.Header>
				<TextBlock Text="{x:Static resx:Resources.gbSoundBoards_Header}"/><commit_msg>Adjusted namespaces (renamed according to standards and removed unnecessary), Removed unnecessary elements<commit_after>﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    xmlns:converters="clr-namespace:SoundBoard.ViewModel.Converters"
	xmlns:helpers="clr-namespace:SoundBoard.Helpers"
	xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
    xmlns:dragDrop="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"
	xmlns:viewModel="clr-namespace:SoundBoard.ViewModel"
    xmlns:resx="clr-namespace:SoundBoard.Properties"
	x:Name="window"
    mc:Ignorable="d" x:Class="SoundBoard.View.MainWindow"
	Title="Acillatem Sound Board"
	Height="450.042"
	Width="{Binding Width, Mode=TwoWay, Source={x:Static resx:Settings.Default}}"
	MinWidth="600"
	MinHeight="250"
	Icon="Radvisual-Holographic-My-music.ico"
    WindowStartupLocation="CenterScreen">
    <Window.Resources>
        <ResourceDictionary>
        	<helpers:TimeSpanToDoubleSecondsConverter x:Key="TimeSpanToDoubleSecondsConverter"/>
			<Style x:Key="ListViewItem" TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource {x:Type ListViewItem}}">
				<Setter Property="Height" Value="32"/>
			</Style>
			<helpers:DoubleToGridLengthConverter x:Key="DoubleToGridLengthConverter"/>
            <viewModel:MainWindowViewModel x:Key="MainWindowViewModelDataSource" d:IsDataSource="True"/>
            <converters:TimeSpanToVisibilityConverter x:Key="TimeSpanToVisibilityConverter"/>
        	<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
            <DataTemplate x:Key="SoundBoardTemplate">
            	<StackPanel>
            		<TextBlock Text="{Binding Name}" />
            	</StackPanel>
            </DataTemplate>
			<DataTemplate x:Key="SoundColumnNameTemplate">
				<DockPanel>
					<Image VerticalAlignment="Center" Height="24" Width="24" Source="appbar.warning.circle.png" ToolTip="{Binding ErrorInfo.ErrorMessage}" Stretch="Fill" Visibility="{Binding ErrorInfo.HasError, Converter={StaticResource BooleanToVisibilityConverter}}">
						<Image.Effect>
							<DropShadowEffect/>
						</Image.Effect>
					</Image>

					<Label x:Name="textBlock" Content="{Binding Name}" ToolTip="{Binding FileName}">
						<i:Interaction.Triggers>
							<i:EventTrigger EventName="MouseDoubleClick">
								<i:InvokeCommandAction Command="{Binding Commands.ActivateSingleSoundCommand, Mode=OneWay, Source={StaticResource MainWindowViewModelDataSource}}" CommandParameter="{Binding DataContext, ElementName=textBlock}"/>
							</i:EventTrigger>
						</i:Interaction.Triggers>
					</Label>
				</DockPanel>
			</DataTemplate>
            <DataTemplate x:Key="ActiveSoundColumnNameTemplate">
                <DockPanel>
                    <Image Source="appbar.clock.png" Height="17" Width="17"  Visibility="{Binding Delay, Converter={StaticResource TimeSpanToVisibilityConverter}}" />
					<Label x:Name="Delay" Content="{Binding Delay.TotalSeconds}" Visibility="{Binding Delay, Converter={StaticResource TimeSpanToVisibilityConverter}}" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="0,0,10,0" ContentStringFormat="s" />
                    <Label x:Name="textBlock" Content="{Binding Name}" ToolTip="{Binding FileName}">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="MouseDoubleClick">
                                <i:InvokeCommandAction Command="{Binding Commands.DeactivateSingleSoundCommand, Mode=OneWay, Source={StaticResource MainWindowViewModelDataSource}}" CommandParameter="{Binding DataContext, ElementName=textBlock}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </Label>
                </DockPanel>
            </DataTemplate>
	        <DataTemplate x:Key="SoundColumnIsLoopedTemplate">
				<CheckBox HorizontalAlignment="Center" IsChecked="{Binding IsLooped, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
			</DataTemplate>

			<DataTemplate x:Key="SoundColumnVolumeTemplate">
				<Slider x:Name="slider" Width="75"
					Value="{Binding VolumeInPercent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
					AutoToolTipPlacement="BottomRight" Maximum="100" LargeChange="10" SmallChange="1"
					VerticalAlignment="Center" ToolTip="Volume" />
			</DataTemplate>

			<DataTemplate x:Key="SoundColumnDelayTemplate">
                <xctk:DoubleUpDown Minimum="0" Value="{Binding Delay, Converter={StaticResource TimeSpanToDoubleSecondsConverter}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsManipulationEnabled="True" ParsingNumberStyle="AllowDecimalPoint" Background="Transparent" BorderBrush="{DynamicResource NormalBorderBrush}" Foreground="{DynamicResource TextBrush}"/>
			</DataTemplate>
	        <helpers:ListViewStretchedColumnWidthConverter x:Key="ListViewActualWidthToRemainingColumnWidthConverter" />
        </ResourceDictionary>
    </Window.Resources>
	<i:Interaction.Triggers>
		<i:EventTrigger EventName="Closing">
			<i:InvokeCommandAction Command="{Binding Commands.ShutdownAppCommand, Mode=OneWay, Source={StaticResource MainWindowViewModelDataSource}}"/>
		</i:EventTrigger>
	</i:Interaction.Triggers>
	<Grid x:Name="WindowGrid" DataContext="{Binding Source={StaticResource MainWindowViewModelDataSource}}">
		<Grid.RowDefinitions>
			<RowDefinition Height="{Binding SoundBoardSoundsHeight, Converter={StaticResource DoubleToGridLengthConverter}, Mode=TwoWay, Source={x:Static resx:Settings.Default}, UpdateSourceTrigger=PropertyChanged}" />
			<RowDefinition Height="10"/>
			<RowDefinition />
		</Grid.RowDefinitions>
		<GroupBox x:Name="gbSoundBoards"
			Grid.ColumnSpan="2" Grid.Row="0">
			<GroupBox.Header>
				<TextBlock Text="{x:Static resx:Resources.gbSoundBoards_Header}"/>
{'fraction_non_alphanumeric': 0.1315471394037067, 'fraction_numerical': 0.010341122750470052, 'mean_word_length': 4.701761102603369, 'pattern_counts': {'":': 0, '<': 193, '<?xml version=': 0, '>': 193, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 26}, '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': '6797334', 'n_tokens_mistral': 4935, 'n_tokens_neox': 4118, 'n_words': 602}