<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="800" d:DesignHeight="450"
             x:Class="SPTInstaller.CustomControls.TitleBar">

	<Grid ColumnDefinitions="AUTO,*,AUTO,AUTO">

		<Rectangle Grid.ColumnSpan="6" IsHitTestVisible="False"
				   Fill="{Binding Background, RelativeSource={
                      RelativeSource AncestorType=UserControl}}"
                 />

		<Label Content="{Binding Title, RelativeSource={
			               RelativeSource AncestorType=UserControl}}"
			   IsHitTestVisible="False"
			   Foreground="{Binding Foreground, RelativeSource={
			                  RelativeSource AncestorType=UserControl}}"
			   Background="Transparent"
			   VerticalContentAlignment="Center"
			     />

		<!-- Minimize (-) Button -->
		<Button Content="&#xE949;" Grid.Column="2"
				Foreground="{Binding ButtonForeground, RelativeSource={
												 RelativeSource AncestorType=UserControl}}"
				Command="{Binding MinButtonCommand, RelativeSource={
			                RelativeSource AncestorType=UserControl}}"
				Background="Transparent"
				HorizontalContentAlignment="Center"
				VerticalContentAlignment="Center"
				VerticalAlignment="Stretch"
				FontFamily="Segoe MDL2 Assets"
				CornerRadius="0"
				Width="35"
            >
			<Button.Styles>
				<Style Selector="Button:pointerover /template/ ContentPresenter">
					<Setter Property="Background" Value="{StaticResource AKI_Brush_DarkGrayBlue}"/>
					<Setter Property="BorderThickness" Value="0"/>
				</Style>
				<Style Selector="Button:pressed /template/ ContentPresenter">
					<Setter Property="Background" Value="{StaticResource AKI_Background_Light}"/>
				</Style>
			</Button.Styles>
		</Button>

		<!-- Close (X) Button -->
		<Button Content="&#xE106;" Grid.Column="3"
				Foreground="{Binding ButtonForeground, RelativeSource={
				             RelativeSource AncestorType=UserControl}}"
				Command="{Binding XButtonCommand, RelativeSource={
			                RelativeSource AncestorType=UserControl}}"
				Background="Transparent"
				HorizontalContentAlignment="Center"
				VerticalContentAlignment="Center"
				VerticalAlignment="Stretch"
				FontFamily="Segoe MDL2 Assets"
				CornerRadius="0"
				Width="35"
            >
			<Button.Styles>
				<Style Selector="Button:pointerover /template/ ContentPresenter">
					<Setter Property="Background" Value="IndianRed"/>
					<Setter Property="BorderThickness" Value="0"/>
				</Style>
				<Style Selector="Button:pressed /template/ ContentPresenter">
					<Setter Property="Background" Value="Crimson"/>
				</Style>
			</Button.Styles>
		</Button>

	</Grid>

</UserControl>