<Window x:Class="HandBrakeWPF.Views.ErrorView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
        xmlns:converters="clr-namespace:HandBrakeWPF.Converters"
        Title="{Binding Title}"
        Width="680"
        Height="380"
        MinWidth="680"
        MinHeight="380"
        FontSize="11"
        TextOptions.TextFormattingMode="Display"
        WindowStartupLocation="CenterOwner">

    <Window.Resources>
        <converters:ThemeImageConverter x:Key="themeConverter" />
    </Window.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <!--  Header  -->
        <Image Width="64" Height="64" Margin="10,4,0,4" Source="Images/ErrorX.png" Grid.Column="0" />

        <Grid Margin="10,0,0,0" Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <TextBlock Grid.Row="0" Margin="0,5,0,0" Text="{Binding ErrorMessage}" Style="{StaticResource subHeader}" TextWrapping="Wrap"  />
            <TextBlock Grid.Row="1" Margin="0,5,0,0" Text="{Binding Solution}" TextWrapping="Wrap" />
            <TextBlock Grid.Row="2" Margin="0,15,0,0" VerticalAlignment="Bottom" Style="{StaticResource sectionHeader}" Text="{x:Static Properties:Resources.ErrorView_ErrorDetails}" />
        </Grid>

        <!--  Details  -->
        <TextBox x:Name="errorText"  Grid.Row="1" Margin="10,5,10,5" Grid.Column="1"
                 HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VerticalContentAlignment="Top" IsReadOnly="True" Text="{Binding Details}"
                 TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" />

        <!--  Controls  -->
        <Grid Grid.Row="2" HorizontalAlignment="Stretch" Grid.ColumnSpan="2" Margin="0,0,10,5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <Button Grid.Column="1"
                    Margin="5"
                    Command="{Binding RelayCommand}" CommandParameter="Copy"
                    Padding="8,2">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Image Grid.Column="0"
                           Width="16"
                           Height="16"
                           Margin="0,0,5,0"
                           Source="{Binding Converter={StaticResource themeConverter}, ConverterParameter='Copy.png'}" />
                    <TextBlock Grid.Column="1" Text="{x:Static Properties:Resources.Generic_CopyToClipboard}" />
                </Grid>
            </Button>

            <Button Grid.Column="2" IsDefault="True" Command="{Binding RelayCommand}" CommandParameter="Close" Content="{x:Static Properties:Resources.Generic_Close}"/>
        </Grid>
    </Grid>
</Window>
