<UserControl
    x:Name="Root"
    x:Class="ModernWpf.SampleApp.ControlPages.ControlPaletteTestContent"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:ui="http://schemas.modernwpf.com/2019"
    xmlns:sc="clr-namespace:SamplesCommon;assembly=SamplesCommon"
    mc:Ignorable="d"
    Foreground="{DynamicResource SystemControlPageTextBaseHighBrush}">

    <UserControl.Resources>
        <Style TargetType="HeaderedContentControl">
            <Setter Property="Margin" Value="0,0,0,28" />
            <Setter Property="IsTabStop" Value="False" />
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <TextBlock
                            Text="{Binding}"
                            Style="{StaticResource BaseTextBlockStyle}"
                            Margin="0,0,0,16" />
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="ui:SimpleStackPanel">
            <Setter Property="Spacing" Value="12" />
        </Style>
    </UserControl.Resources>

    <StackPanel Margin="24,20,24,20">

        <Border
            Height="40"
            Margin="0,0,0,20">
            <TextBlock
                VerticalAlignment="Center"
                FontWeight="SemiBold"
                LineHeight="20"
                Style="{StaticResource SubtitleTextBlockStyle}"
                Text="{Binding ElementName=Root, Path=Title}" />
        </Border>

        <HeaderedContentControl Header="Buttons">
            <ui:SimpleStackPanel>
                <Button
                    x:Name="Button"
                    Content="Enabled button" />
                <Button
                    Content="Disabled button"
                    IsEnabled="False" />
                <ToggleButton Content="Toggle button" />
                <ToggleButton
                    Content="Toggled button"
                    IsChecked="True" />
                <Button
                    Style="{DynamicResource AccentButtonStyle}"
                    Content="Enabled accent button" />
                <Button
                    Style="{DynamicResource AccentButtonStyle}"
                    Content="Disabled accent button"
                    IsEnabled="False" />
            </ui:SimpleStackPanel>
        </HeaderedContentControl>

        <HeaderedContentControl Header="Checkbox">
            <ui:SimpleStackPanel>
                <CheckBox Content="Unchecked" />
                <CheckBox
                    Content="Checked"
                    IsChecked="True" />
                <CheckBox
                    Content="Third state"
                    IsThreeState="True"
                    IsChecked="{x:Null}" />
                <CheckBox
                    Content="Disabled"
                    IsChecked="True"
                    IsEnabled="False" />
            </ui:SimpleStackPanel>
        </HeaderedContentControl>

        <HeaderedContentControl Header="Radio button">
            <ui:SimpleStackPanel>
                <RadioButton
                    Content="Unchecked"
                    GroupName="Test1"
                    Initialized="RadioButton_Initialized"/>
                <RadioButton
                    Content="Checked"
                    GroupName="Test1"
                    IsChecked="True"
                    Initialized="RadioButton_Initialized"/>
                <RadioButton
                    Content="Disabled"
                    GroupName="Test2"
                    IsChecked="True"
                    IsEnabled="False"
                    Initialized="RadioButton_Initialized"/>
            </ui:SimpleStackPanel>
        </HeaderedContentControl>

        <HeaderedContentControl Header="Combo box">
            <ui:SimpleStackPanel>
                <ComboBox Width="200">
                    <ComboBoxItem
                        Content="Item 1"
                        IsSelected="True" />
                    <ComboBoxItem Content="Item 2" />
                    <ComboBoxItem Content="Item 3" />
                </ComboBox>
                <ComboBox
                    Width="200"
                    IsEditable="True">
                    <ComboBoxItem
                        Content="Editable item 1"
                        IsSelected="True" />
                    <ComboBoxItem Content="Editable item 2" />
                    <ComboBoxItem Content="Editable item 3" />
                </ComboBox>
            </ui:SimpleStackPanel>
        </HeaderedContentControl>

        <HeaderedContentControl Header="Textbox">
            <TextBox
                ui:ControlHelper.PlaceholderText="Enter text here"
                Width="200"
                HorizontalAlignment="Left" />
        </HeaderedContentControl>

        <HeaderedContentControl Header="Toggle switch">
            <ui:SimpleStackPanel>
                <ui:ToggleSwitch IsOn="False" />
                <ui:ToggleSwitch IsOn="True" />
            </ui:SimpleStackPanel>
        </HeaderedContentControl>

        <HeaderedContentControl Header="Slider">
            <Slider
                Maximum="100"
                Value="50"
                AutoToolTipPlacement="TopLeft" />
        </HeaderedContentControl>

        <HeaderedContentControl Header="List view">
            <ListView HorizontalAlignment="Stretch">
                <ListView.Items>
                    <ListViewItem
                        Content="Howdy! (disabled)"
                        IsEnabled="False" />
                    <ListViewItem
                        Content="Aloha! (selected)"
                        IsSelected="True" />
                    <ListViewItem Content="Hello!" />
                    <ListViewItem Content="Hola!" />
                </ListView.Items>
            </ListView>
        </HeaderedContentControl>

        <HeaderedContentControl Header="Command bar">
            <ui:CommandBar>
                <ui:AppBarButton Label="Refresh" Icon="Refresh" />
                <ui:AppBarButton Label="New" Icon="Add" />
                <ui:AppBarButton Label="Select" Icon="Bullets" />
                <ui:CommandBar.SecondaryCommands>
                    <ui:AppBarButton Label="Share" Icon="Share" />
                    <ui:AppBarButton Label="Print" Icon="Print" />
                    <ui:AppBarSeparator />
                    <ui:AppBarButton Label="Settings" />
                    <ui:AppBarButton Label="Send feedback" />
                </ui:CommandBar.SecondaryCommands>
            </ui:CommandBar>
        </HeaderedContentControl>

        <HeaderedContentControl Header="Calendar">
            <Calendar HorizontalAlignment="Stretch" />
        </HeaderedContentControl>

        <HeaderedContentControl Header="Date picker">
            <DatePicker Width="200" />
        </HeaderedContentControl>

    </StackPanel>
</UserControl>
