<UserControl x:Class="Serein.Workbench.Views.FlowLibrarysView"
             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:local="clr-namespace:Serein.Workbench.Views"
             xmlns:converter="clr-namespace:Serein.Workbench.Converters"
             xmlns:custom="clr-namespace:Serein.Workbench.Customs"
             xmlns:vm="clr-namespace:Serein.Workbench.ViewModels"
             mc:Ignorable="d" 
             d:DataContext="{d:DesignInstance vm:FlowLibrarysViewModel}"
             d:DesignHeight="450" d:DesignWidth="800"
             AllowDrop="True"
             Drop="FlowLibrarysView_Drop" 
             DragOver="FlowLibrarysView_DragOver" >

    <UserControl.Resources>
        <converter:CountToVisibilityConverter x:Key="CountToVisibilityConverter"/>

       
        <!--<DataTemplate x:Key="NodeListTemplate">
            <Grid Margin="2">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding NodeType}"/>
                    <TextBlock Text="{Binding AnotherName}" Margin="4,0,0,0"/>
                    <TextBlock Text="{Binding MethodName}" Margin="6,0,0,0"/>
                </StackPanel>
            </Grid>
        </DataTemplate>-->
    </UserControl.Resources>

    <ScrollViewer>
        <ItemsControl ItemsSource="{Binding FlowLibraryInfos}">
            <ItemsControl.ItemTemplate >
                <DataTemplate>
                    <Grid Margin="6,6,2,10">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                        </Grid.RowDefinitions>
                        <StackPanel Grid.Row="0" Orientation="Horizontal">
                            <TextBlock Text="{Binding LibraryName}" ></TextBlock>
                            <TextBlock Text="{Binding FilePath}" Margin="6,0,0,0"></TextBlock>
                        </StackPanel>
                        <custom:FlowMethodInfoListBox Grid.Row="1"  ItemsSource="{Binding ActionNodes}" Background="#D0F1F9"/>
                        <custom:FlowMethodInfoListBox Grid.Row="2"  ItemsSource="{Binding FlipflopNodes}" Background="#FACFC1"/>
                        <custom:FlowMethodInfoListBox Grid.Row="3"  ItemsSource="{Binding UINodes}" Background="#FFFBD7"/>
                        
                        <!--<ListBox Grid.Row="1" Margin="6,2,2,2" ItemsSource="{Binding ActionNodes}"
                                  Visibility="{Binding ActionNodes, Converter={StaticResource CountToVisibilityConverter}}"
                                  Background="#D0F1F9"
                                  ItemTemplate="{StaticResource NodeListTemplate}">
                        </ListBox>

                        <ListBox Grid.Row="2" Margin="6,2,2,2" ItemsSource="{Binding FlipflopNodes}" 
                                  Visibility="{Binding FlipflopNodes, Converter={StaticResource CountToVisibilityConverter}}"
                                  Background="#FACFC1"
                                  ItemTemplate="{StaticResource NodeListTemplate}">
                        </ListBox>

                        <ListBox Grid.Row="3" Margin="6,2,2,2" ItemsSource="{Binding UINodes}"
                                  Visibility="{Binding UINodes, Converter={StaticResource CountToVisibilityConverter}}"
                                  Background="#FFFBD7"
                                 ItemTemplate="{StaticResource NodeListTemplate}">
                        </ListBox>-->

                    </Grid>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </ScrollViewer>
</UserControl>


<!--<custom:FlowMethodInfoListBox Grid.Row="1"  Nodes="{Binding ActionNodes}" BackgroundColor="#D0F1F9"/>
    <custom:FlowMethodInfoListBox Grid.Row="2"  Nodes="{Binding FlipflopNodes}" BackgroundColor="#FACFC1"/>
    <custom:FlowMethodInfoListBox Grid.Row="3"  Nodes="{Binding UINodes}" BackgroundColor="#FFFBD7"/>             -->
                        