<Window x:Class="PixiEditor.Views.Dialogs.ConfirmationPopup"
        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:system="clr-namespace:System;assembly=System.Runtime" 
        xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours" 
        xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
        xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
        xmlns:views="clr-namespace:PixiEditor.Views"
        xmlns:helpers="clr-namespace:PixiEditor.Helpers"
        xmlns:ui="clr-namespace:PixiEditor.Extensions.UI;assembly=PixiEditor.Extensions"
        mc:Ignorable="d" d:Title="Unsaved changes"
        Name="popup" WindowStartupLocation="CenterScreen" 
        Height="180" Width="400" MinHeight="180" MinWidth="400"
        WindowStyle="None"
        ui:Translator.Key="{Binding ElementName=popup, Path=Title}"
        FlowDirection="{helpers:Localization FlowDirection}"
        d:DataContext="{d:DesignInstance dial:ConfirmationPopup}">

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

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

        <dial:DialogTitleBar DockPanel.Dock="Top"
            TitleKey="{Binding ElementName=popup, Path=Title}" CloseCommand="{Binding DataContext.CancelCommand, ElementName=popup}" />

        <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Center"
                    Margin="0,0,10,15">
            <Button Margin="10,0,10,0" IsDefault="True" Padding="5 0"
                    Command="{Binding Path=DataContext.SetResultAndCloseCommand, ElementName=popup}"
                    ui:Translator.LocalizedString="{Binding FirstOptionText}"
                    Style="{StaticResource DarkRoundButton}">
                <Button.CommandParameter>
                    <system:Boolean>True</system:Boolean>
                </Button.CommandParameter>
            </Button>
            <Button Padding="5 0"
                    Command="{Binding Path=DataContext.SetResultAndCloseCommand, ElementName=popup}"
                    ui:Translator.LocalizedString="{Binding SecondOptionText}"
                    Style="{StaticResource DarkRoundButton}">
                <Button.CommandParameter>
                    <system:Boolean>False</system:Boolean>
                </Button.CommandParameter>
            </Button>
            <Button Margin="10,0,10,0" Style="{StaticResource DarkRoundButton}" ui:Translator.Key="CANCEL"
                    Command="{Binding DataContext.CancelCommand, ElementName=popup}" />
        </StackPanel>

        <TextBlock
                   Text="{Binding Body, ElementName=popup}" 
                   HorizontalAlignment="Center" Margin="20,0" 
                   TextWrapping="WrapWithOverflow" 
                   TextTrimming="WordEllipsis"
                   TextAlignment="Center"
                   VerticalAlignment="Center" FontSize="15" Foreground="White" d:Text="The document has been modified. Do you want to save changes?"/>
    </DockPanel>
</Window>
