<UserControl x:Class="AIStudio.Wpf.DiagramDesigner.Demo.Views.CustomGroupView"
             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:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram"
             xmlns:controls="clr-namespace:AIStudio.Wpf.DiagramDesigner.Demo.Controls"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <UserControl.Resources>
        <dd:ColorBrushConverter x:Key="ColorBrushConverter" />
    </UserControl.Resources>
    <Grid>
        <!-- Diagram Control -->
        <dd:DiagramControl x:Name="diagram" DataContext="{Binding DiagramViewModel}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
            <dd:DiagramControl.ResourceDictionary>
                <ResourceDictionary>
                    <!--覆盖系统默认样式-->
                    <DataTemplate DataType="{x:Type dd:GroupDesignerItemViewModel}">
                        <Border BorderThickness="{Binding ColorViewModel.LineWidth}" 
                                BorderBrush="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}"
                                IsHitTestVisible="False">
                            <Grid HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,-25,0,0">                              
                                <Ellipse Width="100" 
                                         Height="50" 
                                         StrokeThickness="{Binding ColorViewModel.LineWidth}"
                                         Stroke="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}"
                                         Fill="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}"/>
                                <TextBlock Text="Group" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                            </Grid>
                        </Border>
                    </DataTemplate>
                </ResourceDictionary>
            </dd:DiagramControl.ResourceDictionary>
        </dd:DiagramControl>

        <controls:TitleControl/>
    </Grid>
</UserControl>
