<ui:Page
    x:Class="ModernWpf.SampleApp.ControlPages.GroupBoxPage"
    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:ModernWpf.SampleApp.ControlPages"
    xmlns:ui="http://schemas.modernwpf.com/2019"
    mc:Ignorable="d">

    <Page.Resources>
        <Style x:Key="ComboBoxHeaderStyle" TargetType="TextBlock" BasedOn="{StaticResource BodyTextBlockStyle}">
            <Setter Property="Margin" Value="0,0,0,4" />
        </Style>
        <Style TargetType="ComboBox" BasedOn="{StaticResource {x:Type ComboBox}}">
            <Setter Property="MinWidth" Value="180" />
            <Setter Property="Margin" Value="0,0,0,12" />
        </Style>
    </Page.Resources>

    <ScrollViewer>
        <ui:SimpleStackPanel
            Style="{StaticResource ControlPageContentPanelStyle}"
            Width="404"
            HorizontalAlignment="Left"
            Spacing="0">
            <TextBlock
                Text="Power &amp; Sleep"
                Style="{StaticResource TitleTextBlockStyle}"
                FontSize="28"
                Margin="0,8,0,12" />
            <GroupBox Header="Screen">
                <StackPanel>
                    <TextBlock
                        Text="On battery power, turn off after"
                        Style="{StaticResource ComboBoxHeaderStyle}" />
                    <ComboBox>
                        <ComboBoxItem IsSelected="True">5 minutes</ComboBoxItem>
                    </ComboBox>

                    <TextBlock
                        Text="When plugged in, turn off after"
                        Style="{StaticResource ComboBoxHeaderStyle}" />
                    <ComboBox>
                        <ComboBoxItem IsSelected="True">10 minutes</ComboBoxItem>
                    </ComboBox>
                </StackPanel>
            </GroupBox>
            <GroupBox Header="Sleep">
                <StackPanel>
                    <TextBlock
                        Text="On battery power, PC goes to sleep after"
                        Style="{StaticResource ComboBoxHeaderStyle}" />
                    <ComboBox>
                        <ComboBoxItem IsSelected="True">5 minutes</ComboBoxItem>
                    </ComboBox>

                    <TextBlock
                        Text="When plugged in, PC goes to sleep after"
                        Style="{StaticResource ComboBoxHeaderStyle}" />
                    <ComboBox>
                        <ComboBoxItem IsSelected="True">10 minutes</ComboBoxItem>
                    </ComboBox>
                </StackPanel>
            </GroupBox>
            <GroupBox Header="Network connection">
                <StackPanel>
                    <TextBlock
                        Text="When my PC is asleep and on battery power, disconnect from the network"
                        Style="{StaticResource ComboBoxHeaderStyle}" />
                    <ComboBox>
                        <ComboBoxItem IsSelected="True">Never</ComboBoxItem>
                    </ComboBox>
                </StackPanel>
            </GroupBox>
        </ui:SimpleStackPanel>
    </ScrollViewer>
</ui:Page>
