<UserControl x:Class="AIStudio.Wpf.DiagramDesigner.Demo.Views.DragAndDropView"
             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">
    <Grid x:Name="grid">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <!-- ToolBox Control -->
        <dd:FlowchartToolBoxControl Grid.Column="0"  />

        <GridSplitter Grid.Column="1"
						  HorizontalAlignment="Left"
						  VerticalAlignment="Stretch"
						  Background="Transparent"
						  Width="3" />

        <!-- Diagram Control -->
        <dd:DiagramControl Grid.Column="1" x:Name="diagram" DataContext="{Binding DiagramViewModel}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />

        <controls:TitleControl  Grid.Column="1" Grid.ColumnSpan="2"/>

        <dd:PropertiesView Grid.Column="2" CustomSetting="True" SelectedObject="{Binding SelectedItem}" Width="200">
            <dd:PropertiesView.Resources>

                <Style x:Key="ActTypeStyle" TargetType="{x:Type ContentControl}">
                    <Setter Property="ContentTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <Grid DataContext="{Binding Path=DataContext,RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}">
                                    <ComboBox BorderThickness="0" Text="{Binding ActType}" Style="{StaticResource ComboBoxStyle}">
                                        <ComboBoxItem Content="or"/>
                                        <ComboBoxItem Content="and"/>
                                    </ComboBox>
                                </Grid>
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
                <Style x:Key="UserIdsStyle" TargetType="{x:Type ContentControl}">
                    <Setter Property="ContentTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <Grid DataContext="{Binding Path=DataContext,RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}">
                                    <dd:MultiSelectComboBox BorderThickness="0" DisplayMemberPath="text" SelectedValuePath="value"
                                        SelectedValues="{Binding UserIds}"
                                        ItemsSource="{Binding Path=DataContext.Users,RelativeSource={RelativeSource AncestorType={x:Type Window}}}"  ></dd:MultiSelectComboBox>
                                </Grid>
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
                <Style x:Key="RoleIdsStyle" TargetType="{x:Type ContentControl}">
                    <Setter Property="ContentTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <Grid DataContext="{Binding Path=DataContext,RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}">
                                    <dd:MultiSelectComboBox BorderThickness="0" DisplayMemberPath="text" SelectedValuePath="value"
                                        SelectedValues="{Binding RoleIds}"
                                        ItemsSource="{Binding Path=DataContext.Roles,RelativeSource={RelativeSource AncestorType={x:Type Window}}}"></dd:MultiSelectComboBox>
                                </Grid>
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </dd:PropertiesView.Resources>
        </dd:PropertiesView>

    </Grid>
</UserControl>
