<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:viewmodel="clr-namespace:AIStudio.Wpf.Script.ViewModels" 
                    xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram"
                    xmlns:avEditEx="clr-namespace:TextEditLib;assembly=TextEditLib"
                    xmlns:reskeys="clr-namespace:TextEditLib.Themes;assembly=TextEditLib"
                    xmlns:helper="clr-namespace:AIStudio.Wpf.Script.Helpers"
                    xmlns:controls="clr-namespace:AIStudio.Wpf.Script.Controls">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/TextEditLib;component/Themes/Icons.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <dd:ColorBrushConverter x:Key="ColorBrushConverter"/>

    <DataTemplate DataType="{x:Type viewmodel:ColorBoxCollectorScriptViewModel}">
        <Grid IsHitTestVisible="False">
            <Border BorderThickness="{Binding BorderThickness}" 
                        BorderBrush="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}" 
                        Background="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}"
                        CornerRadius="{Binding CornerRadius}"
                        IsHitTestVisible="False">
            </Border>
            <ItemsControl ItemsSource="{Binding ItemsSource}" Margin="5">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapPanel/>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Grid Margin="1">
                            <Path 
                              Data="{Binding Path}" 
                              Fill="{Binding Color,Converter={StaticResource ColorBrushConverter}}"
                              Stretch="Fill"
                              Width="20"
                              Height="20"/>
                            <TextBlock 
                                Text="{Binding Text}"
                                FontSize="9"
                                HorizontalAlignment="Center" 
                                VerticalAlignment="Center"/>
                        </Grid>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
            <TextBlock Text="{Binding OrderNumber,StringFormat={}{0}#}" Foreground="Blue" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="2"/>
            <StackPanel Margin="-45,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center">
                <Path 
                              Data="{Binding Tag.Path}" 
                              Fill="{Binding Tag.Color,Converter={StaticResource ColorBrushConverter}}"
                              Stretch="Fill"
                              Width="16"
                              Height="16"/>
                <TextBlock 
                                Text="{Binding Tag.Text}"
                                FontSize="9"
                                HorizontalAlignment="Center" 
                                VerticalAlignment="Center"/>
            </StackPanel>
        </Grid>
    </DataTemplate>

</ResourceDictionary>