<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d" d:DesignWidth="400" d:DesignHeight="90" MaxHeight="90" MinHeight="90" MinWidth="300"
             x:Class="LibationAvalonia.Views.ProcessBookControl" Background="{Binding BackgroundColor}">
	
	<Border BorderBrush="{DynamicResource ProcessQueueBookBorderBrush}" BorderThickness="2">
		<Grid ColumnDefinitions="Auto,*,Auto">
			
			<Panel Grid.Column="0" Margin="3" Background="LightGray" Width="80" Height="80" HorizontalAlignment="Left">
				<Image Width="80" Height="80" Source="{Binding Cover}" Stretch="Uniform" />
			</Panel>
			<Grid Margin="0,3,0,3" Grid.Column="1" ColumnDefinitions="1*" RowDefinitions="1*,16">
				<StackPanel Grid.Column="0" Grid.Row="0" Orientation="Vertical">
					<TextBlock ClipToBounds="True" TextWrapping="Wrap" FontSize="11" Text="{Binding Title}" />
					<TextBlock FontSize="10" TextWrapping="NoWrap" Text="{Binding Author}" />
					<TextBlock FontSize="10" TextWrapping="NoWrap" Text="{Binding Narrator}" />
				</StackPanel>
				<Panel Grid.Column="0" Grid.Row="1">
					<Panel.Styles>
						<Style Selector="ProgressBar:horizontal">
							<Setter Property="MinWidth" Value="20" />
						</Style>
					</Panel.Styles>
					<ProgressBar IsVisible="{Binding IsDownloading}" Value="{Binding Progress}" ShowProgressText="True" FontSize="12" />
					<TextBlock IsVisible="{Binding !IsDownloading}" Text="{Binding StatusText}"/>
				</Panel>
			</Grid>
			<Grid Margin="3" Grid.Column="2" HorizontalAlignment="Right" ColumnDefinitions="Auto,Auto">
				<StackPanel IsVisible="{Binding Queued}" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Vertical">
					<Button Height="20" Width="30" Click="MoveFirst_Click">
						<Image Height="20" Width="30" Source="/Assets/first.png" Stretch="Uniform" VerticalAlignment="Bottom"/>
					</Button>
					<Button Height="20" Width="30" Click="MoveUp_Click">
						<Image Height="20" Width="30" Source="/Assets/up.png" Stretch="Uniform" VerticalAlignment="Bottom" />
					</Button>
					<Button Height="20" Width="30" Click="MoveDown_Click">
						<Image Height="20" Width="30" Source="/Assets/down.png" Stretch="Uniform" VerticalAlignment="Top" />
					</Button>
					<Button Height="20" Width="30" Click="MoveLast_Click">
						<Image Height="20" Width="30" Source="/Assets/last.png" Stretch="Uniform" VerticalAlignment="Top"/>
					</Button>
				</StackPanel>
				<Panel Margin="3" Grid.Column="1" VerticalAlignment="Top">
					<Button Height="32" Width="22" IsVisible="{Binding !IsFinished}" CornerRadius="11" Click="Cancel_Click">
						<Image Width="20" Height="20" Source="/Assets/cancel.png" Stretch="Uniform" />
					</Button>
				</Panel>
			</Grid>
			<Panel Margin="3" Width="50" Grid.Column="2">
				<TextPresenter FontSize="9" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsVisible="{Binding IsDownloading}" Text="{Binding ETA}" />
			</Panel>
			
		</Grid>
	</Border>
</UserControl>
