<Window x:Class="PixiEditor.Views.Dialogs.ExportFilePopup"
        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:behaviours="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" BorderBrush="Black" BorderThickness="1"
        WindowStyle="None" MinHeight="330" MinWidth="310" Width="310"
        ui:Translator.Key="EXPORT_IMAGE"
        SizeToContent="Height"
        WindowStartupLocation="CenterScreen" Name="saveFilePopup"
        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>
            <behaviours:ClearFocusOnClickBehavior/>
        </i:Interaction.Behaviors>


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

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

        <Border HorizontalAlignment="Center" Margin="15,30,15,0" Background="{StaticResource MainColor}"
                    VerticalAlignment="Stretch" CornerRadius="10">
            <Grid MinHeight="205" MinWidth="240">
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                    <userControls:SizePicker Margin="0,15,0,0"
                                             x:Name="sizePicker"
                                             SizeUnitSelectionVisibility="Visible"
                                             VerticalAlignment="Top"
                                             ChosenHeight="{Binding Path=SaveHeight, Mode=TwoWay, ElementName=saveFilePopup}"
                                             ChosenWidth="{Binding Path=SaveWidth, Mode=TwoWay, ElementName=saveFilePopup}" />
            <TextBlock Grid.Row="1" Foreground="Snow" Margin="5,0,5,10" TextWrapping="Wrap" VerticalAlignment="Bottom" TextAlignment="Center" 
                       Width="200">
                <Hyperlink Command="{Binding SetBestPercentageCommand, ElementName=saveFilePopup}">
                    <Run Text="{Binding SizeHint, Mode=OneTime, ElementName=saveFilePopup}" d:Text="If you want to share the image, try 400% for the best clarity" />
                </Hyperlink>
            </TextBlock>
            </Grid>
        </Border>

    </DockPanel>
</Window>
