<UserControl x:Class="ImageResizer.Views.ProgressPage"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
             xmlns:local="clr-namespace:ImageResizer.Views"
             xmlns:p="clr-namespace:ImageResizer.Properties"
             Background="{DynamicResource PrimaryBackgroundBrush}"
             MinWidth="350">

    <UserControl.Resources>
        <local:TimeRemainingConverter x:Key="TimeRemainingConverter"/>
    </UserControl.Resources>

    <behaviors:Interaction.Triggers>
        <behaviors:EventTrigger EventName="Loaded">
            <behaviors:InvokeCommandAction Command="{Binding StartCommand}"/>
        </behaviors:EventTrigger>
    </behaviors:Interaction.Triggers>

    <StackPanel>
        <TextBlock Margin="12,12,12,0"
                   FontSize="16"
                   Foreground="{DynamicResource PrimaryForegroundBrush}"
                   Text="{x:Static p:Resources.Progress_MainInstruction}"/>
        <TextBlock Margin="12,12,12,0"
                   Foreground="{DynamicResource PrimaryForegroundBrush}"
                   Text="{Binding TimeRemaining,Converter={StaticResource TimeRemainingConverter}}"/>
        <ProgressBar Height="16"
                     Margin="12,12,12,0"
                     Value="{Binding Progress}"
                     Maximum="1"/>
        <Border Margin="0,12,0,0"
                Background="{DynamicResource SecondaryBackgroundBrush}"
                BorderBrush="{DynamicResource PrimaryBorderBrush}"
                BorderThickness="0,1,0,0"
                Padding="12,12">
            <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
                <Button MinWidth="76"
                        Style="{StaticResource AccentButtonStyle}"
                        Command="{Binding StopCommand}"
                        Content="{x:Static p:Resources.Progress_Stop}"
                        IsCancel="True"/>
            </StackPanel>
        </Border>
    </StackPanel>
</UserControl>
