<Window x:Class="HandBrakeWPF.Views.PopupWindowView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:cal="http://www.caliburnproject.org"
             xmlns:properties="clr-namespace:HandBrakeWPF.Properties"
             xmlns:converters="clr-namespace:HandBrakeWPF.Converters"
             d:DesignHeight="250"
             d:DesignWidth="650"
             MaxHeight="650"
             Title="{Binding Title}"
             ResizeMode="NoResize"
             SizeToContent="WidthAndHeight"
             WindowStartupLocation="CenterScreen"
             TextOptions.TextFormattingMode="Display"
             mc:Ignorable="d">
    
    <Window.Resources>
        <converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
    </Window.Resources>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <TextBlock Text="{Binding WindowTitle}" FontSize="26" FontFamily="Segoe UI Light" Margin="10,10,10,5" Grid.Row="0" />
        <TextBlock Text="{Binding SubText}" Margin="10,0,10,15" Grid.Row="1" Visibility="{Binding SubTextVisible, Converter={StaticResource boolToVisConverter}}"
                   TextWrapping="Wrap"/>

        <Border BorderBrush="DarkGray" BorderThickness="0,1,0,0" Grid.Row="2" Margin="0,0,0,0">
            <ScrollViewer  VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,10,0,0" VerticalScrollBarVisibility="Auto"   >
                <ContentControl x:Name="ContentViewModel"/>
            </ScrollViewer>
        </Border>

        <Border BorderBrush="DarkGray"  Grid.Row="3"  BorderThickness="0,1,0,0"  Margin="0,20,0,0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <Button Grid.Column="1"
                    Margin="0,5,10,10"
                    cal:Message.Attach="[Event Click] = [Action Cancel]"
                    Content="{x:Static properties:Resources.Generic_Cancel}"
                    IsCancel="True"
                    Visibility="Collapsed"
                    Padding="8,2" />
                <Button Grid.Column="2"
                    Margin="0,5,10,10"
                    cal:Message.Attach="[Event Click] = [Action Save]"
                    Content="{x:Static properties:Resources.Generic_Save}"
                    IsDefault="True"
                    Padding="8,2" />
            </Grid>
        </Border>

    </Grid>
   
</Window>
