<Window 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="630" d:DesignHeight="480"
        x:Class="LibationAvalonia.Dialogs.TrashBinDialog"
		xmlns:dialogs="clr-namespace:LibationAvalonia.Dialogs"
		xmlns:views="clr-namespace:LibationAvalonia.Views"
		x:DataType="dialogs:TrashBinViewModel"
		x:CompileBindings="True"
		MinWidth="680" MinHeight="480" 
		Width="680" Height="480"
        Title="Trash Bin"
		WindowStartupLocation="CenterOwner"
		Icon="/Assets/libation.ico">
	
	<Grid Margin="5"
		RowDefinitions="Auto,Auto,*,Auto">
		
		<TextBlock Text="Check books you want to permanently delete from or restore to Libation"/>

		<Grid Margin="0,5" Grid.Row="1" Grid.ColumnDefinitions="Auto,*,Auto">
			<TextBlock VerticalAlignment="Center" Text="Search Deleted Books:"/>
			<TextBox Name="searchTb" Margin="5,0" Grid.Column="1" Text="{Binding FilterString}" IsEnabled="{Binding ControlsEnabled}">
				<TextBox.KeyBindings>
					<KeyBinding Command="{Binding FilterBtnAsync}" Gesture="Enter" />
				</TextBox.KeyBindings>
			</TextBox>
			<Button Classes="SaveButton" Grid.Column="2" Command="{Binding FilterBtnAsync}" IsEnabled="{Binding ControlsEnabled}" VerticalAlignment="Stretch" Content="Filter" />
		</Grid>

		<views:ProductsDisplay
			Grid.Row="2"
			DisableContextMenu="True"
			DisableColumnCustomization="True"
			IsEnabled="{Binding $parent.((dialogs:TrashBinViewModel)DataContext).ControlsEnabled}"
			DataContext="{Binding ProductsDisplay}" />

		<Grid
			Margin="0,5,0,0"
			Grid.Row="3"
			ColumnDefinitions="Auto,Auto,Auto,Auto,*,Auto">

			<CheckBox
				IsEnabled="{Binding	ControlsEnabled}"
				IsThreeState="True"
				Margin="0,0,14,0"
				IsChecked="{Binding EverythingChecked}"
				Content="Everything" />
			
			<TextBlock
				Grid.Column="1"
				Margin="0,0,14,0"
				VerticalAlignment="Center"
				Text="{Binding CheckedCountText}" />

			<CheckBox
				Grid.Column="2"
				IsEnabled="{Binding	ControlsEnabled}"
				IsThreeState="True"
				Margin="0,0,15,0"
				IsChecked="{Binding AudiblePlusChecked}"
				Content="Audible Plus Books" />
			
			<TextBlock
				Grid.Column="3"
				VerticalAlignment="Center"
				Text="{Binding AudiblePlusCheckedCountText}" />
			
			<Button
				IsEnabled="{Binding	ControlsEnabled}"
				Grid.Column="4"
				Margin="0,0,20,0"
				HorizontalAlignment="Right"
				VerticalAlignment="Stretch"
				VerticalContentAlignment="Center"
				Content="Restore"
				Command="{Binding RestoreCheckedAsync}"/>
			
			<Button
				IsEnabled="{Binding	ControlsEnabled}"
				Grid.Column="5"
				Command="{Binding PermanentlyDeleteCheckedAsync}" >
				<TextBlock
					TextAlignment="Center"
					Text="Permanently Delete&#xa;from Libation" />
			</Button>
		</Grid>
	</Grid>
</Window>
