<Window x:Class="Translator.ExceptionViewer"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:n="clr-namespace:Translator.Controls"
        Title="Exception Viewer" WindowStartupLocation="CenterScreen" 
        UseLayoutRounding="True" Topmost="True" SnapsToDevicePixels="True"
        MinWidth="640" MinHeight="490" Width="640" Height="490" Background="{DynamicResource Panel.Background}">

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

        <Grid Grid.Row="0" Background="{DynamicResource Panel.Background.Level4}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <Viewbox Grid.Column="0" Margin="4" Child="{StaticResource Vector.Error}"/>

            <Label Grid.Column="1" x:Name="TypeLabel" Content="Exception Type" Margin="5" VerticalContentAlignment="Center" 
                   FontFamily="Segoe UI Semilight" FontSize="16" Foreground="{DynamicResource Element.Foreground.Header}">
                <Label.ToolTip>
                    <ToolTip Content="Exception Type" Placement="Top" HorizontalOffset="-5"/>
                </Label.ToolTip>
            </Label>

            <n:ImageButton Grid.Column="2" x:Name="InnerButton" Text="Open Inner Exception" Content="{StaticResource Vector.Synchronize}" MaxSize="20" 
                           Margin="3" Padding="2" Style="{StaticResource Style.Button.Horizontal}" IsEnabled="False" FontSize="12" FontFamily="Segoe UI Semilight" 
                           Click="InnerButton_Click"/>
        </Grid>

        <TextBox x:Name="MessageTextBox" Margin="3" Grid.Row="1" TextWrapping="Wrap" MinHeight="50" FontSize="14" ScrollViewer.CanContentScroll="True" 
                 VerticalScrollBarVisibility="Auto" FontFamily="Segoe UI Semibold" IsReadOnly="True" MaxHeight="150">
            <TextBox.ToolTip>
                <ToolTip Content="Message" Placement="Left" HorizontalOffset="-5" VerticalOffset="-5"/>
            </TextBox.ToolTip>
        </TextBox>

        <TextBox x:Name="StackTextBox" Margin="3" Grid.Row="2" TextWrapping="Wrap" MinHeight="23" ScrollViewer.CanContentScroll="True" VerticalScrollBarVisibility="Auto" IsReadOnly="True">
            <TextBox.ToolTip>
                <ToolTip Content="Stack" Placement="Left" HorizontalOffset="-5" VerticalOffset="-5"/>
            </TextBox.ToolTip>
        </TextBox>

        <TextBox x:Name="SourceTextBox" Margin="3" Grid.Row="3" TextWrapping="Wrap" MinHeight="23" FontSize="12" FontFamily="Segoe UI Semibold" IsReadOnly="True">
            <TextBox.ToolTip>
                <ToolTip Content="Source" Placement="Left" HorizontalOffset="-5" VerticalOffset="-5"/>
            </TextBox.ToolTip>
        </TextBox>

        <Grid Grid.Row="4" Background="{DynamicResource Panel.Background.Level3}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <n:ImageButton Grid.Column="1" x:Name="OkButton" Text="Ok" Content="{StaticResource Vector.Ok}" MaxSize="20" Padding="4,0" Margin="5" MinWidth="90" IsDefault="True" Click="DoneButton_Click"/>
        </Grid>
    </Grid>
</Window>