<UserControl x:Class="F4SDicons.User_Controls.IconGrid"
             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:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
             xmlns:local="clr-namespace:F4SDicons.User_Controls"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800"
             DataContext="{Binding RelativeSource={RelativeSource Self}}">

    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibility"/>
    </UserControl.Resources>

    <StackPanel x:Name="GridCollection">

        <ItemsControl ItemsSource="{Binding IconInformation}">

            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>

                    <ico:AdaptableIcon x:Name="adaptableIcon" ToolTip="{Binding IconName}" Tag="{Binding IconName}" SelectedInternIcon="{Binding InternIcon}" SelectedMaterialIcon="{Binding MaterialIcon}" MouseLeftButtonUp="adaptableIcon_MouseLeftButtonUp" TouchDown="adaptableIcon_TouchDown" Visibility="{Binding IsVisible, Converter = {StaticResource BooleanToVisibility}}" Style="{DynamicResource GridIconStyle}"/>

                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>

    </StackPanel>
</UserControl>
