<Window x:Class="PixiEditor.Views.Dialogs.NewFilePopup"
        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:local="clr-namespace:PixiEditor.Views"
        xmlns:vm="clr-namespace:PixiEditor.ViewModels"
        xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours"
        xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
        xmlns:userControls="clr-namespace:PixiEditor.Views.UserControls"
        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
        xmlns:ui="clr-namespace:PixiEditor.Extensions.UI;assembly=PixiEditor.Extensions"
        mc:Ignorable="d"
        ShowInTaskbar="False"
        DataContext="{DynamicResource NewFileMenuViewModel}" 
        WindowStyle="None" 
        WindowStartupLocation="CenterScreen" 
        MinHeight="250" Height="250"
        SizeToContent="Width"
        Name="newFilePopup" 
        BorderBrush="Black" BorderThickness="1"
        FlowDirection="{helpers:Localization FlowDirection}"
        ui:Translator.Key="CREATE_NEW_IMAGE">
    <Window.Resources>
        <vm:NewFileMenuViewModel x:Key="NewFileMenuViewModel" />
    </Window.Resources>
    <WindowChrome.WindowChrome>
        <WindowChrome CaptionHeight="32"  GlassFrameThickness="0.1"
                      ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
    </WindowChrome.WindowChrome>

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

    <DockPanel Background="{StaticResource AccentColor}" Focusable="True">
        <i:Interaction.Behaviors>
            <behaviors:ClearFocusOnClickBehavior/>
        </i:Interaction.Behaviors>

        <dial:DialogTitleBar DockPanel.Dock="Top"
            TitleKey="CREATE_NEW_IMAGE" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}" />

        <Button DockPanel.Dock="Bottom" Margin="0,15,0,15" HorizontalAlignment="Center"
                IsDefault="True" ui:Translator.Key="CREATE" x:Name="createButton"
                Style="{StaticResource DarkRoundButton}" 
                Command="{Binding OkCommand}"
                CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />

        <userControls:SizePicker HorizontalAlignment="Center" MinWidth="230" Height="125" Margin="15,30,15,0"
                              PreserveAspectRatio="False"
                              ChosenHeight="{Binding FileHeight, Mode=TwoWay, ElementName=newFilePopup}"
                              ChosenWidth="{Binding FileWidth, Mode=TwoWay, ElementName=newFilePopup}" 
                              x:Name="sizePicker"/>
    </DockPanel>
</Window>
