<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ui="http://schemas.modernwpf.com/2019"
    xmlns:utils="clr-namespace:MUXControlsTestApp">

    <Style TargetType="utils:TestFrame">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="Background" Value="{DynamicResource ApplicationPageBackgroundThemeBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="utils:TestFrame">
                    <Grid x:Name="RootGrid">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition />
                        </Grid.RowDefinitions>

                        <Grid x:Name="TestFrameBar" VerticalAlignment="Top" HorizontalAlignment="Stretch" Background="{DynamicResource ApplicationPageBackgroundThemeBrush}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>

                            <StackPanel Orientation="Horizontal"
                                        WindowChrome.IsHitTestVisibleInChrome="True">
                                <Button x:Name="BackButton" Margin="0,0,4,0"
                                        Style="{DynamicResource AccentButtonStyle}"
                                        AutomationProperties.AutomationId="__BackButton" 
                                        Width="48"
                                        Visibility="Collapsed">
                                    <ui:SymbolIcon Symbol="Back"/>
                                </Button>
                                <Button x:Name="ToggleThemeButton"
                                        VerticalAlignment="Stretch"
                                        Style="{DynamicResource AccentButtonStyle}"
                                        AutomationProperties.AutomationId="__ToggleThemeButton" 
                                        Content="Toggle theme">
                                </Button>

                                <TextBlock x:Name="CurrentPageTextBlock" AutomationProperties.AutomationId="__CurrentPage"  FontSize="18" VerticalAlignment="Center" Margin="10,0,0,0"/>
                            </StackPanel>
                        </Grid>

                        <Border Grid.Row="1"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Padding="{TemplateBinding Padding}">
                            <ContentPresenter
                                Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
