<Application xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="using:LibationAvalonia"
             xmlns:controls="using:LibationAvalonia.Controls"
             xmlns:dialogs="using:LibationAvalonia.Dialogs"
			 x:Class="LibationAvalonia.App"
             Name="Libation">

	<Application.DataTemplates>
		<local:ViewLocator/>
	</Application.DataTemplates>

	<Application.Resources>

		<ResourceDictionary>
			<ControlTheme x:Key="{x:Type TextBlock}" TargetType="TextBlock">
				<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" />
				<Setter Property="Background" Value="Transparent" />
			</ControlTheme>
			<ControlTheme x:Key="{x:Type DataGridCell}" TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
				<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" />
			</ControlTheme>
			<ControlTheme x:Key="{x:Type DataGridColumnHeader}" TargetType="DataGridColumnHeader" BasedOn="{StaticResource {x:Type DataGridColumnHeader}}">
				<Setter Property="Padding" Value="6,0,0,0" />
			</ControlTheme>
			<x:Double x:Key="DataGridSortIconMinWidth">0</x:Double>

			<ResourceDictionary.ThemeDictionaries>
				<ResourceDictionary x:Key="Light">
					<SolidColorBrush x:Key="SeriesEntryGridBackgroundBrush" Opacity="0.3" Color="#abffab" />
					<SolidColorBrush x:Key="ProcessQueueBookFailedBrush" Color="LightCoral" />
					<SolidColorBrush x:Key="ProcessQueueBookCompletedBrush" Color="PaleGreen" />
					<SolidColorBrush x:Key="ProcessQueueBookCancelledBrush" Color="Khaki" />
					<SolidColorBrush x:Key="HyperlinkNew" Color="Blue" />
					<SolidColorBrush x:Key="HyperlinkVisited" Color="Purple" />
					<SolidColorBrush x:Key="CancelRed" Color="FireBrick" />
					<SolidColorBrush x:Key="IconFill" Color="#231F20" />
					<SolidColorBrush x:Key="StoplightRed" Color="#F06060" />
					<SolidColorBrush x:Key="StoplightYellow" Color="#F0E160" />
					<SolidColorBrush x:Key="StoplightGreen" Color="#70FA70" />
				</ResourceDictionary>
				<ResourceDictionary x:Key="Dark">
					<SolidColorBrush x:Key="SeriesEntryGridBackgroundBrush" Opacity="0.3" Color="#bed2fa" />
					<SolidColorBrush x:Key="ProcessQueueBookFailedBrush" Color="#502727" />
					<SolidColorBrush x:Key="ProcessQueueBookCompletedBrush" Color="#1c3e20" />
					<SolidColorBrush x:Key="ProcessQueueBookCancelledBrush" Color="#4e4b15" />
					<SolidColorBrush x:Key="HyperlinkNew" Color="CornflowerBlue" />
					<SolidColorBrush x:Key="HyperlinkVisited" Color="Orchid" />
					<SolidColorBrush x:Key="CancelRed" Color="#802727" />
					<SolidColorBrush x:Key="IconFill" Color="#DCE0DF" />
					<SolidColorBrush x:Key="StoplightRed" Color="#7d1f1f" />
					<SolidColorBrush x:Key="StoplightYellow" Color="#7d7d1f" />
					<SolidColorBrush x:Key="StoplightGreen" Color="#1f7d1f" />					
				</ResourceDictionary>
			</ResourceDictionary.ThemeDictionaries>
		</ResourceDictionary>		
	</Application.Resources>

	<Application.Styles>
		<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/>
		<StyleInclude Source="avares://Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml" />
		<StyleInclude Source="/Assets/LibationVectorIcons.xaml"/>
		<FluentTheme>
			<FluentTheme.Palettes>
				<ColorPaletteResources x:Key="Light" />
				<ColorPaletteResources x:Key="Dark" />
			</FluentTheme.Palettes>
		</FluentTheme>

		<Style Selector="TextBox[IsReadOnly=true]">
			<Setter Property="Background" Value="{DynamicResource SystemChromeDisabledHighColor}" />
			<Setter Property="CaretBrush" Value="{DynamicResource SystemControlTransparentBrush}" />
			<Style Selector="^ /template/ Border#PART_BorderElement">
				<Setter Property="Background" Value="{DynamicResource SystemChromeDisabledHighColor}" />
			</Style>
		</Style>
		<Style Selector="controls|LinkLabel">
			<Setter Property="Foreground" Value="{DynamicResource HyperlinkNew}"/>
			<Setter Property="ForegroundVisited" Value="{DynamicResource HyperlinkVisited}"/>
		</Style>
		<Style Selector="Button">
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Style Selector="^">
				<Setter Property="Foreground" Value="{DynamicResource SystemChromeAltLowColor}" />
			</Style>
		</Style>
		<Style Selector="ScrollBar">
			<!-- It's called AutoHide, but this is really the mouseover shrink/expand. -->
            <Setter Property="AllowAutoHide" Value="false"/>
		</Style>

		<Style Selector="dialogs|DialogWindow">
			<Setter Property="SystemDecorations" Value="Full"/>
			<Setter Property="Icon" Value="/Assets/libation.ico"/>
			<Setter Property="Template">
				<ControlTemplate>
					<ContentPresenter Background="{DynamicResource SystemRegionColor}" Content="{TemplateBinding Content}" />
				</ControlTemplate>
			</Setter>
		</Style>		
	</Application.Styles>

	<NativeMenu.Menu>
		<NativeMenu>
			<NativeMenuItem Header="About Libation" />
		</NativeMenu>
	</NativeMenu.Menu>

</Application>