<Window x:Class="PixiEditor.Views.Dialogs.ImportShortcutTemplatePopup"
        x:ClassModifier="internal"
        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:diag="clr-namespace:PixiEditor.Views.Dialogs"
        xmlns:userControls="clr-namespace:PixiEditor.Views.UserControls"
        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
        xmlns:views="clr-namespace:PixiEditor.Views"
        xmlns:ui="clr-namespace:PixiEditor.Extensions.UI;assembly=PixiEditor.Extensions"
        mc:Ignorable="d"
        Title="Import from template" Foreground="White"
        WindowStartupLocation="CenterOwner"
        MinWidth="580"
        SizeToContent="WidthAndHeight" WindowStyle="None"
        Background="{StaticResource AccentColor}"
        x:Name="window"
        FlowDirection="{helpers:Localization FlowDirection}"
        ui:Translator.Key="IMPORT_FROM_TEMPLATE">

    <Window.CommandBindings>
        <CommandBinding Command="{x:Static SystemCommands.CloseWindowCommand}" CanExecute="CommandBinding_CanExecute"
                        Executed="CommandBinding_Executed_Close" />
    </Window.CommandBindings>

    <WindowChrome.WindowChrome>
        <WindowChrome CaptionHeight="32" GlassFrameThickness="0.1"
                      ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
    </WindowChrome.WindowChrome>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="32"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <diag:DialogTitleBar DockPanel.Dock="Top"
                             TitleKey="IMPORT_FROM_TEMPLATE" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
        <ItemsControl Grid.Row="1" ItemsSource="{Binding Templates, ElementName=window}"
                      Margin="10,10,10,5">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal"/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <userControls:ShortcutsTemplateCard 
                        TemplateName="{Binding Name}" Margin="0 0 5 0" 
                        Logo="{Binding LogoPath}" Cursor="Hand" 
                        MouseLeftButtonUp="OnTemplateCardLeftMouseButtonDown"
                        HoverLogo="{Binding Path=HoverLogoPath}"/>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </Grid>
</Window>
