<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"
        xmlns:dialogs="clr-namespace:LibationAvalonia.Dialogs"
        mc:Ignorable="d" d:DesignWidth="400" d:DesignHeight="350"
        Width="800" Height="450"
        x:Class="LibationAvalonia.Dialogs.EditQuickFilters"
        Title="Audible Accounts"
		Icon="/Assets/libation.ico"
		x:DataType="dialogs:EditQuickFilters">
	<Grid RowDefinitions="*,Auto">

		<Grid.Styles>
			<Style Selector="Button:focus">
				<Setter Property="BorderBrush" Value="{DynamicResource SystemAccentColor}" />
				<Setter Property="BorderThickness" Value="2" />
			</Style>
		</Grid.Styles>

		<DataGrid
			Grid.Row="0"
			CanUserReorderColumns="False"
			CanUserResizeColumns="False"
			CanUserSortColumns="False"
			AutoGenerateColumns="False"
			IsReadOnly="False"
			ItemsSource="{Binding Filters}"
			GridLinesVisibility="All">

			<DataGrid.Columns>

				<DataGridTemplateColumn Header="Delete">
					<DataGridTemplateColumn.CellTemplate>
						<DataTemplate>

							<Button
								Content="X"
								VerticalAlignment="Stretch"
								HorizontalAlignment="Stretch"
								HorizontalContentAlignment="Center"
								IsEnabled="{Binding !IsDefault}"
								Click="DeleteButton_Clicked" />

						</DataTemplate>
					</DataGridTemplateColumn.CellTemplate>
				</DataGridTemplateColumn>

				<DataGridTextColumn
    				Width="*"
				    IsReadOnly="False"
				    Binding="{Binding Name, Mode=TwoWay}"
				    Header="Name"/>


				<DataGridTextColumn
					Width="*"
					IsReadOnly="False"
					Binding="{Binding FilterString, Mode=TwoWay}"
					Header="Filter"/>

				<DataGridTemplateColumn Header="Move&#xa;Up">
					<DataGridTemplateColumn.CellTemplate>
						<DataTemplate>

							<Button
								Content="▲"
								VerticalAlignment="Stretch"
								HorizontalAlignment="Stretch"
								HorizontalContentAlignment="Center"
								IsEnabled="{Binding !IsDefault}"
								ToolTip.Tip="Export account authorization to audible-cli"
								Click="MoveUpButton_Clicked" />

						</DataTemplate>
					</DataGridTemplateColumn.CellTemplate>
				</DataGridTemplateColumn>



				<DataGridTemplateColumn Header="Move&#xa;Down">
					<DataGridTemplateColumn.CellTemplate>
						<DataTemplate>

							<Button
								Content="▼"
								VerticalAlignment="Stretch"
								HorizontalAlignment="Stretch"
								HorizontalContentAlignment="Center"
								IsEnabled="{Binding !IsDefault}"
								ToolTip.Tip="Export account authorization to audible-cli"
								Click="MoveDownButton_Clicked" />

						</DataTemplate>
					</DataGridTemplateColumn.CellTemplate>
				</DataGridTemplateColumn>


			</DataGrid.Columns>
		</DataGrid>
		<Grid
			Grid.Row="1"
			Margin="10"
			ColumnDefinitions="*,Auto" >

			<Button
				Grid.Column="1"
				Padding="30,5"
				Name="saveBtn"
				Content="Save"
				Command="{Binding SaveAndClose}" />
		</Grid>
	</Grid>
</Window>
