<Window x:Class="PixiEditor.Views.Dialogs.CrashReportDialog"
        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:vm="clr-namespace:PixiEditor.ViewModels"
        xmlns:dial="clr-namespace:PixiEditor.Views.Dialogs"
        d:DataContext="{d:DesignInstance vm:CrashReportViewModel}"
        mc:Ignorable="d"
        Background="{StaticResource AccentColor}" Foreground="White"
        Title="PixiEditor has crashed!" WindowStyle="None"
        MinWidth="480" MinHeight="195"
        WindowStartupLocation="CenterScreen"
        Width="480" Height="195">

    <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>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <dial:DialogTitleBar TitleKey="PixiEditor has crashed!" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}" />
        <Grid Grid.Row="1" Margin="30,30,30,0" >
            <StackPanel>
                <Grid Background="{StaticResource MainColor}">
                    <StackPanel Margin="7" VerticalAlignment="Center">
                        <TextBlock Text="{Binding DocumentCount, StringFormat={}{0} file(s) might be recoverable}"
                       d:Text="2 file(s) can be recovered"/>
                        <TextBlock TextWrapping="Wrap">You can help the developers fix this bug by sending a crash report that was generated (you will still be able to recover the files).</TextBlock>
                    </StackPanel>
                </Grid>

                <WrapPanel Margin="0,20,0,5" Orientation="Horizontal" HorizontalAlignment="Center">
                    <Button Command="{Binding OpenSendCrashReportCommand}"
                        Width="120"
                        Style="{StaticResource DarkRoundButton}">Send report</Button>
                    <Button Margin="5,0,5,0" Width="120"
                        Command="{Binding RecoverDocumentsCommand}"
                        Style="{StaticResource DarkRoundButton}">Recover files</Button>
                    <Button Visibility="{Binding IsDebugBuild, Converter={BoolToVisibilityConverter}}"
                    Style="{StaticResource DarkRoundButton}" Width="170"
                    Command="{Binding AttachDebuggerCommand}">(Re)Attach debugger</Button>
                </WrapPanel>
            </StackPanel>
        </Grid>
    </Grid>
</Window>
