<Window x:Class="DragonISO.App.PreviewWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:shell="clr-namespace:System.Windows.Shell;assembly=PresentationFramework"
        Title="Preview"
        Icon="/Assets/DragonISO.ico"
        Width="640" Height="400"
        MinWidth="320" MinHeight="200"
        Background="Black"
        WindowStyle="None"
        ResizeMode="CanResize"
        UseLayoutRounding="True">

    <shell:WindowChrome.WindowChrome>
        <shell:WindowChrome
            CaptionHeight="32"
            ResizeBorderThickness="6"
            CornerRadius="0"
            GlassFrameThickness="0"
            UseAeroCaptionButtons="False"/>
    </shell:WindowChrome.WindowChrome>

    <Border BorderBrush="{DynamicResource Wd.Border}" BorderThickness="1">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <!-- Caption -->
            <Grid Grid.Row="0" Background="{DynamicResource Wd.Surface}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock x:Name="TitleText"
                           Text="Preview"
                           Style="{StaticResource Wd.Text.Caption}"
                           Margin="14,0,0,0"
                           VerticalAlignment="Center"/>
                <TextBlock Grid.Column="1"
                           x:Name="ResolutionText"
                           Style="{StaticResource Wd.Text.Mono}"
                           FontSize="11"
                           Foreground="{DynamicResource Wd.Text.Tertiary}"
                           VerticalAlignment="Center"
                           Margin="0,0,12,0"/>
                <Button Grid.Column="2"
                        Style="{StaticResource Wd.Button.CaptionClose}"
                        Click="OnClose"
                        shell:WindowChrome.IsHitTestVisibleInChrome="True">
                    <Path Data="M 0,0 L 10,10 M 10,0 L 0,10"
                          Stroke="{DynamicResource Wd.Text.Primary}"
                          StrokeThickness="1.2"
                          Width="10" Height="10"
                          Stretch="None"/>
                </Button>
            </Grid>

            <!-- Live preview -->
            <Image Grid.Row="1"
                   x:Name="PreviewImage"
                   Stretch="Uniform"
                   RenderOptions.BitmapScalingMode="HighQuality"/>
        </Grid>
    </Border>
</Window>
