<UserControl x:Class="InABox.DynamicGrid.FormHeader"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:InABox.DynamicGrid"
             mc:Ignorable="d"
             x:Name="UserControl">

    <UserControl.Resources>
        <Style TargetType="Image">
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=Collapsed, ElementName=UserControl}" Value="False">
                    <Setter Property="RenderTransform">
                        <Setter.Value>
                            <RotateTransform Angle="90"/>
                        </Setter.Value>
                    </Setter>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>

    <Button Click="Button_Click" HorizontalContentAlignment="Left" Cursor="Hand"
            Background="Transparent" BorderBrush="Transparent">
        <StackPanel Orientation="Horizontal">
            <Image Width="32" Height="32"
                   RenderTransformOrigin="0.5,0.5" Source="/InABox.DynamicGrid;component/Resources/header_closed.png"/>
            <Label Content="{Binding Path=HeaderText, ElementName=UserControl}" FontWeight="Bold"
                   HorizontalContentAlignment="Left"
                   VerticalContentAlignment="Center"/>
        </StackPanel>
    </Button>
</UserControl>
