<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:cal="http://www.caliburnproject.org"
        Title="{Binding Title}" Height="380" Width="680" FontSize="11" Background="#FFF0F0F0">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="70" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <!-- Header -->
        <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="0,0,0,0" Background="White">
            <Image Source="Images/ErrorX.png" Width="64" Height="64" Margin="10,0,0,0" />
            <Grid Margin="10,0,0,0" Height="64">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <TextBlock Text="{Binding ErrorMessage}" FontWeight="Bold" Grid.Row="0" Margin="0,5,0,0" />
                <TextBlock Text="{Binding Solution}" Grid.Row="1" Margin="0,5,0,0" />

                <TextBlock Text="Error Details:" FontWeight="Bold" Margin="0,0,0,2" VerticalAlignment="Bottom" Grid.Row="2" />
            </Grid>
        </StackPanel>

        <!-- Details -->
        <TextBox Text="{Binding Details}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" IsReadOnly="True" TextWrapping="Wrap" 
                         VerticalScrollBarVisibility="Auto" Margin="84,10,10,10" Grid.Row="1"  />


        <!-- Controls -->
        <Grid Grid.Row ="2" Background="LightGray">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <Button Padding="8,2" Margin="5" Grid.Column="1" cal:Message.Attach="[Event Click] = [Action Copy]">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Image Source="Images/copy.png" Grid.Column="0" Width="16" Height="16" Margin="0,0,5,0" />
                    <TextBlock Text="Copy" Grid.Column="1" />
                </Grid>
            </Button>

            <Button Content="Close" Padding="8,2" Margin="0,5,10,5" Grid.Column="2" cal:Message.Attach="[Event Click] = [Action Close]"></Button>
        </Grid>
    </Grid>
</Window>
