<commit_before>﻿<UserControl x:Class="Core2D.UI.Wpf.Controls.ContainerControl"
             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:core="clr-namespace:Core2D;assembly=Core2D"
             xmlns:controls="clr-namespace:Core2D.UI.Wpf.Controls"
             xmlns:p="clr-namespace:Core2D.UI.Wpf.Properties"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="200">
    <TabControl>
        <TabItem Header="{x:Static p:Resources.WindowTitleContainer}">
            <ContentControl>
                <ContentControl.Style>
                    <Style TargetType="ContentControl">
                        <Setter Property="Content" Value="{Binding Editor.Project.CurrentContainer}"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Editor.Project.CurrentContainer}" Value="{x:Null}">
                                <Setter Property="Content" Value="{x:Null}"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </ContentControl.Style>
            </ContentControl>
        </TabItem>
        <TabItem Header="{x:Static p:Resources.WindowTitleLayers}">
            <Grid>
                <Grid.Resources>
                    <ControlTemplate x:Key="LayersMenu">
                        <Menu Background="Transparent" HorizontalAlignment="Right">
                            <MenuItem Command="{x:Static core:Commands.AddLayerCommand}" Header="+"/>
                            <MenuItem Command="{x:Static core:Commands.RemoveLayerCommand}" Header="-"/>
                        </Menu>
                    </ControlTemplate>
                </Grid.Resources>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Control Template="{StaticResource LayersMenu}" Grid.Row="0" Margin="2,0,2,0"/>
                <controls:LayerDragAndDropListBox 
                    DataContext="{Binding Editor.Project.CurrentContainer.Layers}"
                    Tag="{Binding DataContext.Editor, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
                    ItemsSource="{Binding}"
                    SelectedItem="{Binding DataContext.Editor.Project.CurrentContainer.CurrentLayer, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" 
                    HorizontalContentAlignment="Stretch"
                    BorderBrush="{x:Null}"
                    Grid.Row="1">
                    <controls:LayerDragAndDropListBox.Resources>
                        <ContextMenu x:Key="LayerContextMenu" 
                                     DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
                            <MenuItem Header="_Add Layer"
                                      InputGestureText="Ctrl+N" 
                                      Command="{Binding DataContext.Commands.AddLayerCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"/>
                            <Separator/>
                            <MenuItem Header="_Delete" 
                                      InputGestureText="Del" 
                                      Command="{Binding DataContext.Commands.RemoveLayerCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"/>
                        </ContextMenu>
                    </controls:LayerDragAndDropListBox.Resources>
                    <controls:LayerDragAndDropListBox.InputBindings>
                        <KeyBinding Command="{Binding DataContext.Commands.AddLayerCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" 
                                    CommandParameter="{Binding Path=SelectedItem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type controls:LayerDragAndDropListBox}}}" 
                                    Gesture="Ctrl+N"/>
                        <KeyBinding Command="{Binding DataContext.Commands.RemoveLayerCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" 
                                    CommandParameter="{Binding Path=SelectedItem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type controls:LayerDragAndDropListBox}}}" 
                                    Gesture="Del"/>
                    </controls:LayerDragAndDropListBox.InputBindings>
                    <controls:LayerDragAndDropListBox.ItemContainerStyle>
                        <Style TargetType="ListBoxItem">
                            <Setter Property="ContextMenu" Value="{StaticResource LayerContextMenu}"/>
                        </Style>
                    </controls:LayerDragAndDropListBox.ItemContainerStyle>
                    <controls:LayerDragAndDropListBox.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="25"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <CheckBox IsChecked="{Binding IsVisible}" 
                                          Margin="0,5,0,5"
                                          Content="" 
                                          VerticalAlignment="Stretch"
                                          HorizontalAlignment="Stretch"
                                          Grid.Column="0"/>
                                <TextBlock Text="{Binding Name}" Margin="0,5,0,5" Grid.Column="1"/>
                            </Grid>
                        </DataTemplate>
                    </controls:LayerDragAndDropListBox.ItemTemplate>
                </controls:LayerDragAndDropListBox>
                <StackPanel DataContext="{Binding Editor.Project.CurrentContainer.CurrentLayer}" Grid.Row="2" Margin="2">
                    <StackPanel.Style>
                        <Style TargetType="StackPanel">
                            <Setter Property="Visibility" Value="Visible"/>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding}" Value="{x:Null}">
                                    <Setter Property="Visibility" Value="Hidden"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </StackPanel.Style>
                    <Expander Header="Name" IsExpanded="True">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="30"/>
                            </Grid.ColumnDefinitions>
                            <TextBox Text="{Binding Name, UpdateSourceTrigger=PropertyChanged, Delay=500}" 
                                     BorderBrush="{x:Null}" 
                                     Margin="5,2,5,2"
                                     Grid.Row="0" 
                                     Grid.Column="0" 
                                     Grid.ColumnSpan="2"
                                     TextAlignment="Left" 
                                     VerticalAlignment="Center">
                            </TextBox>
                        </Grid>
                    </Expander>
                </StackPanel>
            </Grid>
        </TabItem>
        <TabItem Header="{x:Static p:Resources.WindowTitleShapes}">
            <Grid>
                <Grid.Resources>
                    <ControlTemplate x:Key="ShapesMenu">
                        <Menu Background="Transparent" HorizontalAlignment="Right">
                            <MenuItem Command="{x:Static core:Commands.RemoveShapeCommand}" Header="-"/>
                        </Menu>
                    </ControlTemplate>
                </Grid.Resources>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Control Template="{StaticResource ShapesMenu}" Grid.Row="0" Margin="2,0,2,0"/>
                <controls:BaseShapeDragAndDropListBox
                    DataContext="{Binding Editor.Project.CurrentContainer.CurrentLayer.Shapes}"
                    Tag="{Binding DataContext.Editor, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
                    ItemsSource="{Binding}"
                    SelectedItem="{Binding DataContext.Editor.Project.CurrentContainer.CurrentShape, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" 
                    BorderBrush="{x:Null}"
                    HorizontalContentAlignment="Stretch"
                    Grid.Row="1">
                    <controls:BaseShapeDragAndDropListBox.Resources>
                        <ContextMenu x:Key="ShapeContextMenu" 
                                     DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
                            <MenuItem Header="_Delete" 
                                      InputGestureText="Del" 
                                      Command="{Binding DataContext.Commands.RemoveShapeCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"/>
                        </ContextMenu>
                    </controls:BaseShapeDragAndDropListBox.Resources>
                    <controls:BaseShapeDragAndDropListBox.InputBindings>
                        <KeyBinding Command="{Binding DataContext.Commands.RemoveShapeCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" 
                                    CommandParameter="{Binding Path=SelectedItem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type controls:BaseShapeDragAndDropListBox}}}" 
                                    Gesture="Del"/>
                    </controls:BaseShapeDragAndDropListBox.InputBindings>
                    <controls:BaseShapeDragAndDropListBox.ItemContainerStyle>
                        <Style TargetType="ListBoxItem">
                            <Setter Property="ContextMenu" Value="{StaticResource ShapeContextMenu}"/>
                        </Style>
                    </controls:BaseShapeDragAndDropListBox.ItemContainerStyle>
                    <controls:BaseShapeDragAndDropListBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding}" Margin="0,5,0,5"/><commit_msg>Use static commands<commit_after>﻿<UserControl x:Class="Core2D.UI.Wpf.Controls.ContainerControl"
             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:core="clr-namespace:Core2D;assembly=Core2D"
             xmlns:controls="clr-namespace:Core2D.UI.Wpf.Controls"
             xmlns:p="clr-namespace:Core2D.UI.Wpf.Properties"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="200">
    <TabControl>
        <TabItem Header="{x:Static p:Resources.WindowTitleContainer}">
            <ContentControl>
                <ContentControl.Style>
                    <Style TargetType="ContentControl">
                        <Setter Property="Content" Value="{Binding Editor.Project.CurrentContainer}"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Editor.Project.CurrentContainer}" Value="{x:Null}">
                                <Setter Property="Content" Value="{x:Null}"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </ContentControl.Style>
            </ContentControl>
        </TabItem>
        <TabItem Header="{x:Static p:Resources.WindowTitleLayers}">
            <Grid>
                <Grid.Resources>
                    <ControlTemplate x:Key="LayersMenu">
                        <Menu Background="Transparent" HorizontalAlignment="Right">
                            <MenuItem Command="{x:Static core:Commands.AddLayerCommand}" Header="+"/>
                            <MenuItem Command="{x:Static core:Commands.RemoveLayerCommand}" Header="-"/>
                        </Menu>
                    </ControlTemplate>
                </Grid.Resources>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Control Template="{StaticResource LayersMenu}" Grid.Row="0" Margin="2,0,2,0"/>
                <controls:LayerDragAndDropListBox 
                    DataContext="{Binding Editor.Project.CurrentContainer.Layers}"
                    Tag="{Binding DataContext.Editor, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
                    ItemsSource="{Binding}"
                    SelectedItem="{Binding DataContext.Editor.Project.CurrentContainer.CurrentLayer, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" 
                    HorizontalContentAlignment="Stretch"
                    BorderBrush="{x:Null}"
                    Grid.Row="1">
                    <controls:LayerDragAndDropListBox.Resources>
                        <ContextMenu x:Key="LayerContextMenu" 
                                     DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
                            <MenuItem Header="_Add Layer"
                                      InputGestureText="Ctrl+N" 
                                      Command="{x:Static core:Commands.AddLayerCommand}"/>
                            <Separator/>
                            <MenuItem Header="_Delete" 
                                      InputGestureText="Del" 
                                      Command="{x:Static core:Commands.RemoveLayerCommand}"/>
                        </ContextMenu>
                    </controls:LayerDragAndDropListBox.Resources>
                    <controls:LayerDragAndDropListBox.InputBindings>
                        <KeyBinding Command="{x:Static core:Commands.AddLayerCommand}" 
                                    CommandParameter="{Binding Path=SelectedItem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type controls:LayerDragAndDropListBox}}}" 
                                    Gesture="Ctrl+N"/>
                        <KeyBinding Command="{x:Static core:Commands.RemoveLayerCommand}" 
                                    CommandParameter="{Binding Path=SelectedItem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type controls:LayerDragAndDropListBox}}}" 
                                    Gesture="Del"/>
                    </controls:LayerDragAndDropListBox.InputBindings>
                    <controls:LayerDragAndDropListBox.ItemContainerStyle>
                        <Style TargetType="ListBoxItem">
                            <Setter Property="ContextMenu" Value="{StaticResource LayerContextMenu}"/>
                        </Style>
                    </controls:LayerDragAndDropListBox.ItemContainerStyle>
                    <controls:LayerDragAndDropListBox.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="25"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <CheckBox IsChecked="{Binding IsVisible}" 
                                          Margin="0,5,0,5"
                                          Content="" 
                                          VerticalAlignment="Stretch"
                                          HorizontalAlignment="Stretch"
                                          Grid.Column="0"/>
                                <TextBlock Text="{Binding Name}" Margin="0,5,0,5" Grid.Column="1"/>
                            </Grid>
                        </DataTemplate>
                    </controls:LayerDragAndDropListBox.ItemTemplate>
                </controls:LayerDragAndDropListBox>
                <StackPanel DataContext="{Binding Editor.Project.CurrentContainer.CurrentLayer}" Grid.Row="2" Margin="2">
                    <StackPanel.Style>
                        <Style TargetType="StackPanel">
                            <Setter Property="Visibility" Value="Visible"/>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding}" Value="{x:Null}">
                                    <Setter Property="Visibility" Value="Hidden"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </StackPanel.Style>
                    <Expander Header="Name" IsExpanded="True">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="30"/>
                            </Grid.ColumnDefinitions>
                            <TextBox Text="{Binding Name, UpdateSourceTrigger=PropertyChanged, Delay=500}" 
                                     BorderBrush="{x:Null}" 
                                     Margin="5,2,5,2"
                                     Grid.Row="0" 
                                     Grid.Column="0" 
                                     Grid.ColumnSpan="2"
                                     TextAlignment="Left" 
                                     VerticalAlignment="Center">
                            </TextBox>
                        </Grid>
                    </Expander>
                </StackPanel>
            </Grid>
        </TabItem>
        <TabItem Header="{x:Static p:Resources.WindowTitleShapes}">
            <Grid>
                <Grid.Resources>
                    <ControlTemplate x:Key="ShapesMenu">
                        <Menu Background="Transparent" HorizontalAlignment="Right">
                            <MenuItem Command="{x:Static core:Commands.RemoveShapeCommand}" Header="-"/>
                        </Menu>
                    </ControlTemplate>
                </Grid.Resources>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Control Template="{StaticResource ShapesMenu}" Grid.Row="0" Margin="2,0,2,0"/>
                <controls:BaseShapeDragAndDropListBox
                    DataContext="{Binding Editor.Project.CurrentContainer.CurrentLayer.Shapes}"
                    Tag="{Binding DataContext.Editor, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
                    ItemsSource="{Binding}"
                    SelectedItem="{Binding DataContext.Editor.Project.CurrentContainer.CurrentShape, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" 
                    BorderBrush="{x:Null}"
                    HorizontalContentAlignment="Stretch"
                    Grid.Row="1">
                    <controls:BaseShapeDragAndDropListBox.Resources>
                        <ContextMenu x:Key="ShapeContextMenu" 
                                     DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
                            <MenuItem Header="_Delete" 
                                      InputGestureText="Del" 
                                      Command="{x:Static core:Commands.RemoveShapeCommand}"/>
                        </ContextMenu>
                    </controls:BaseShapeDragAndDropListBox.Resources>
                    <controls:BaseShapeDragAndDropListBox.InputBindings>
                        <KeyBinding Command="{x:Static core:Commands.RemoveShapeCommand}" 
                                    CommandParameter="{Binding Path=SelectedItem, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type controls:BaseShapeDragAndDropListBox}}}" 
                                    Gesture="Del"/>
                    </controls:BaseShapeDragAndDropListBox.InputBindings>
                    <controls:BaseShapeDragAndDropListBox.ItemContainerStyle>
                        <Style TargetType="ListBoxItem">
                            <Setter Property="ContextMenu" Value="{StaticResource ShapeContextMenu}"/>
                        </Style>
                    </controls:BaseShapeDragAndDropListBox.ItemContainerStyle>
                    <controls:BaseShapeDragAndDropListBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding}" Margin="0,5,0,5"/>
{'fraction_non_alphanumeric': 0.09902597402597403, 'fraction_numerical': 0.006222943722943723, 'mean_word_length': 1.418693423492202, 'pattern_counts': {'":': 0, '<': 243, '<?xml version=': 0, '>': 243, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 68, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4729575', 'n_tokens_mistral': 5156, 'n_tokens_neox': 4613, 'n_words': 645}