<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"                    
                    xmlns:controls="clr-namespace:AIStudio.Wpf.Flowchart.Controls"
                    xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Flowchart;component/Themes/FlowNode.xaml"/>
        <ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Styles/ComboBox.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="AIStudio.Styles.FlowchartEditor" TargetType="{x:Type controls:FlowchartEditor}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:FlowchartEditor}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <!-- ToolBox Control -->
                        <ContentControl Template="{Binding ToolBox,RelativeSource={RelativeSource AncestorType={x:Type Control}}}"/>

                        <ScrollViewer Grid.Column="1">
                            <!-- Diagram Control -->
                            <dd:DiagramControl x:Name="PART_DiagramControl" MinWidth="1000" MinHeight="1000" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                        </ScrollViewer>
                        <ContentControl Grid.Column="2" x:Name="properity" Template="{Binding PropertiesBox,RelativeSource={RelativeSource AncestorType={x:Type Control}}}"/>

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="AIStudio.Styles.FlowchartEditor.Default" TargetType="{x:Type controls:FlowchartEditor}" BasedOn="{StaticResource AIStudio.Styles.FlowchartEditor}">
        <Setter Property="ToolBox">
            <Setter.Value>
                <ControlTemplate TargetType="Control">
                    <controls:FlowchartToolBoxControl />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="PropertiesBox">
            <Setter.Value>
                <ControlTemplate TargetType="Control">
                    <dd:PropertiesView CustomSetting="True"
                                       SelectedObject="{Binding Path=SelectedObject,RelativeSource={RelativeSource AncestorType={x:Type controls:FlowchartEditor}}}"
                                       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 AIStudio.Diagram.Styles.ComboBox}">
                                                    <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=Users,RelativeSource={RelativeSource AncestorType={x:Type controls:FlowchartEditor}}}"  ></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=Roles,RelativeSource={RelativeSource AncestorType={x:Type controls:FlowchartEditor}}}"></dd:MultiSelectComboBox>
                                            </Grid>
                                        </DataTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </dd:PropertiesView.Resources>
                    </dd:PropertiesView>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type controls:FlowchartEditor}" BasedOn="{StaticResource AIStudio.Styles.FlowchartEditor.Default}" />
</ResourceDictionary>
