<dial:ResizeablePopup x:Class="PixiEditor.Views.Dialogs.ResizeCanvasPopup"
                      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:local="clr-namespace:PixiEditor.Views"
        xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
        xmlns:behaviors="clr-namespace:PixiEditor.Helpers.Behaviours"
        xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
        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"
        mc:Ignorable="d" 
        x:Name="window"
        ShowInTaskbar="False" WindowStartupLocation="CenterScreen"
        ui:Translator.Key="RESIZE_CANVAS"
        Height="420" Width="320" MinHeight="420" MinWidth="320" 
        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_CANVAS" 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" />

        <Border HorizontalAlignment="Center" Margin="0,30,0,0" Background="{StaticResource MainColor}"
                 VerticalAlignment="Top" Grid.Row="1" Width="250" Height="290" CornerRadius="10">
            <StackPanel>
                <userControls:SizePicker Margin="0,8,0,0" 
                                  Width="240"
                                  Height="170"
                                  x:Name="sizePicker"
                                  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"
                                  />
                <Separator Margin="10,5,10,0" Background="{StaticResource AccentColor}" Height="1" />
                <DockPanel>
                    <Label ui:Translator.Key="ANCHOR_POINT" Foreground="White" Margin="25,5,0,0" HorizontalAlignment="Left"
                           FontSize="12" />
                    <userControls:AnchorPointPicker AnchorPoint="{Binding Path=SelectedAnchorPoint, Mode=TwoWay, ElementName=window}"
                                             HorizontalAlignment="Right"
                                             Width="78" Margin="0,10,30,0" Height="78" />
                </DockPanel>
            </StackPanel>
        </Border>
    </DockPanel>
</dial:ResizeablePopup>
