<dial:ResizeablePopup x:Class="PixiEditor.Views.Dialogs.ResizeDocumentPopup"
                      x:ClassModifier="internal"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
        xmlns:local="clr-namespace:PixiEditor.Views" 
        xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours"
        xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
        mc:Ignorable="d" x:Name="window"
        ShowInTaskbar="False" WindowStartupLocation="CenterScreen"
        ui:Translator.Key="RESIZE_IMAGE"
        Height="305" Width="310" MinHeight="305" MinWidth="310"
        xmlns:base="clr-namespace:PixiEditor.Views"
        xmlns:userControls="clr-namespace:PixiEditor.Views.UserControls"
        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
        xmlns:ui="clr-namespace:PixiEditor.Extensions.UI;assembly=PixiEditor.Extensions"
        WindowStyle="None"
        FlowDirection="{helpers:Localization FlowDirection}">

    <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="RESIZE_IMAGE" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>

        <Button DockPanel.Dock="Bottom" Padding="5 0" HorizontalAlignment="Center" Margin="15"
                Style="{StaticResource DarkRoundButton}" ui:Translator.Key="RESIZE" Click="Button_Click" IsDefault="True" />

        <userControls:SizePicker HorizontalAlignment="Center" Width="240" Height="180" Margin="0,30,0,0"
            x:Name="sizePicker"
            PreserveAspectRatio="True"
                          Focusable="True"
            ChosenHeight="{Binding NewAbsoluteHeight, Mode=TwoWay, ElementName=window}"
            ChosenWidth="{Binding NewAbsoluteWidth, Mode=TwoWay, ElementName=window}" 
            ChosenPercentageSize="{Binding NewPercentageSize, Mode=TwoWay, ElementName=window}"
            SelectedUnit="{ Binding NewSelectedUnit, Mode=TwoWay, ElementName=window}"
            SizeUnitSelectionVisibility="Visible"
            />

    </DockPanel>
</dial:ResizeablePopup>
