<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:Sonex.Client.Controls">

    <Style x:Key="PropertyBoxContentExpanderStyle" TargetType="controls:PropertyBoxContentExpander">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:PropertyBoxContentExpander">
                    <Expander
                        MaxWidth="1000"
                        HorizontalContentAlignment="Stretch"
                        HorizontalAlignment="Stretch"
                        Margin="6,6,6,6"
                        Background="{ThemeResource SolidBackgroundFillColorSenaryBrush}"
                        VerticalContentAlignment="Top">
                        <Expander.Header>
                            <Grid Margin="0,0,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>

                                <ContentPresenter
                                    Grid.Column="0"
                                    Content="{TemplateBinding Icon}"
                                    VerticalAlignment="Center"
                                    Margin="0, 18, 18, 18" />

                                <StackPanel Grid.Column="1" Spacing="2" VerticalAlignment="Center">
                                    <TextBlock
                                        VerticalAlignment="Center"
                                        Text="{TemplateBinding Title}"
                                        Style="{ThemeResource BodyTextBlockStyle}"
                                        Foreground="{ThemeResource TextFillColorPrimaryBrush}" />

                                    <TextBlock
                                        VerticalAlignment="Center"
                                        Text="{TemplateBinding Description}"
                                        Style="{ThemeResource CaptionTextBlockStyle}"
                                        Foreground="{ThemeResource TextFillColorSecondaryBrush}"
                                        TextWrapping="Wrap" />
                                </StackPanel>
                            </Grid>
                        </Expander.Header>
                        <Expander.Content>
                            <Grid HorizontalAlignment="Stretch">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <ContentPresenter
                                    Grid.Row="0"
                                    Content="{TemplateBinding Body}"
                                    HorizontalAlignment="{TemplateBinding BodyHorizontalAlignment}"
                                    VerticalAlignment="{TemplateBinding BodyVerticalAlignment}"
                                    Margin="0, 0, 0, 0"
                                    Padding="0 0 0 0" />
                                <ContentPresenter
                                    Grid.Row="1"
                                    Content="{TemplateBinding Footer}"
                                    VerticalAlignment="Center"
                                    HorizontalAlignment="Left"
                                    Margin="0, 18, 0, 0" />
                            </Grid>
                        </Expander.Content>
                    </Expander>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
