<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="965" d:DesignHeight="850"
		Width="965" Height="850"
		x:Class="LibationAvalonia.Dialogs.ThemePickerDialog"
		xmlns:controls="clr-namespace:LibationAvalonia.Controls"
		Title="Theme Editor">
	
	<Grid ColumnDefinitions="Auto,*">
		<controls:ThemePreviewControl Name="ThemePickerPreviewControl" Margin="5" Grid.Column="1" />
		<Grid
			RowDefinitions="*,Auto,Auto">
			<Grid.Styles>
				<Style Selector="Button">
					<Setter Property="Padding" Value="20,6" />
					<Setter Property="Margin" Value="5" />
				</Style>
			</Grid.Styles>
			<DataGrid
				Grid.Row="0"
				GridLinesVisibility="All"
				Margin="5"
				IsReadOnly="False"
				ItemsSource="{Binding ThemeColors}">
				<DataGrid.Columns>
					<DataGridTemplateColumn Width="Auto" Header="Color">
						<DataGridTemplateColumn.CellTemplate>
							<DataTemplate>
								<ColorPicker
									IsHexInputVisible="True"
									Color="{Binding ThemeColor, Mode=TwoWay}" />
							</DataTemplate>
						</DataGridTemplateColumn.CellTemplate>
					</DataGridTemplateColumn>				
					<DataGridTextColumn
						Width="Auto"
						Binding="{Binding ThemeItemName, Mode=TwoWay}"
						Header="Theme Item"/>
				</DataGrid.Columns>
			</DataGrid>
			<Grid
				Grid.Row="1"
				ColumnDefinitions="Auto,*,Auto">
				<Button
					Grid.Column="0"
					Content="Import Theme"
					Command="{Binding ImportTheme}" />
				<Button
					Grid.Column="2"
					Content="Export Theme"
					Command="{Binding ExportTheme}" />
			</Grid>
			<Grid
				Grid.Row="2"
				ColumnDefinitions="Auto,Auto,Auto,*,Auto">			
				<Button
					Grid.Column="0"
					Content="Cancel"
					Command="{Binding CancelAndClose}" />			
				<Button
					Grid.Column="1"
					Content="Reset"
					Command="{Binding ResetColors}" />			
				<Button
					Grid.Column="2"
					Content="Defaults"
					Command="{Binding LoadDefaultColors}" />			
				<Button
					Grid.Column="4"
					Content="Save"
					Command="{Binding SaveAndCloseAsync}" />
			</Grid>
		</Grid>
	</Grid>
</Window>
