<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.Core.Helpers;assembly=AIStudio.Wpf.Script.Core"
                    xmlns:controls="clr-namespace:AIStudio.Wpf.Script.Core.Controls;assembly=AIStudio.Wpf.Script.Core">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/TextEditLib;component/Themes/Icons.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <dd:ColorBrushConverter x:Key="ColorBrushConverter"/>
    
    <DataTemplate DataType="{x:Type viewmodel:ColorBoxFactoryScriptViewModel}">
        <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"/>
        </Grid>
    </DataTemplate>

</ResourceDictionary>