<ContentControl 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:controls="clr-namespace:LibationAvalonia.Controls"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:Class="LibationAvalonia.Controls.GroupBox">

	<ContentControl.Styles>
		<Style Selector="controls|GroupBox Border">
			<Setter Property="BorderBrush" Value="DarkGray" />
		</Style>
		<Style Selector="controls|GroupBox">
			<Setter Property="Template">
				<ControlTemplate>
					<Grid ColumnDefinitions="Auto,*,Auto" RowDefinitions="7,10,*,Auto">

						<Grid
							ZIndex="1"
							Grid.Row="0"
							Grid.RowSpan="2"
							Grid.Column="1" Margin="8,0,0,0"
							ColumnDefinitions="Auto,*"
							VerticalAlignment="Top">
							<TextBlock
								Padding="4,0,4,0"
								Background="{DynamicResource SystemAltHighColor}"
								Text="{TemplateBinding Label}"
								/>
						</Grid>

						<ContentPresenter
							Margin="8,0,8,5"
							Grid.Row="2"
							Grid.Column="1"
							Content="{TemplateBinding Content}"/>

						<Border
							BorderBrush="DarkGray"
							BorderThickness="{TemplateBinding BorderWidth}"
							CornerRadius="3"
							Grid.Column="0"
							Grid.ColumnSpan="3"
							Grid.Row="1"
							Grid.RowSpan="3"/>
					
					</Grid>
				</ControlTemplate>
			</Setter>
		</Style>
	</ContentControl.Styles>
</ContentControl>
