<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<local:TestPage
    x:Class="MUXControlsTestApp.DropDownButtonPage"
    x:Name="DropDownButtonTestPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:MUXControlsTestApp"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:controls="http://schemas.modernwpf.com/2019"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>
        <local:MyCommand x:Key="TestExecuteCommand" />
    </Page.Resources>

    <Grid
        Background="{DynamicResource SystemControlPageBackgroundAltHighBrush}"
        Margin="12">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <ScrollViewer
            Grid.Column="0"
            Height="Auto">
            <StackPanel
                Orientation="Vertical"
                VerticalAlignment="Top"
                HorizontalAlignment="Center"
                Width="Auto"
                Height="Auto">
                <TextBlock
                    Text="Demo controls"
                    Style="{DynamicResource StandardGroupHeader}"
                    Margin="0" />
                <StackPanel
                    Orientation="Horizontal"
                    Margin="0,12,0,0">
                    <controls:DropDownButton
                        x:Name="TestDropDownButton"
                        AutomationProperties.Name="TestDropDownButton"
                        Content="Test Button"
                        Click="TestDropDownButton_Click">
                        <controls:DropDownButton.Flyout>
                            <controls:Flyout
                                x:Name="TestFlyout"
                                AutomationProperties.Name="TestFlyout"
                                Placement="Bottom"
                                Opened="TestDropDownButtonFlyout_Opened"
                                Closed="TestDropDownButtonFlyout_Closed">
                                <TextBlock Text="Hello" />
                            </controls:Flyout>
                        </controls:DropDownButton.Flyout>
                    </controls:DropDownButton>

                    <Button
                        Margin="6,0,0,0"
                        Content="For Comparison">
                        <controls:FlyoutService.Flyout>
                            <controls:Flyout>
                                <TextBlock Text="Button flyout" />
                            </controls:Flyout>
                        </controls:FlyoutService.Flyout>
                    </Button>
                </StackPanel>


                <TextBlock
                    Text="Options"
                    Style="{DynamicResource StandardGroupHeader}"
                    Margin="0,16,0,8" />
                <CheckBox
                    x:Name="SetFlyoutCheckbox"
                    AutomationProperties.Name="SetFlyoutCheckbox"
                    IsChecked="True"
                    Content="Flyout set"
                    Checked="SetFlyoutCheckbox_Checked"
                    Unchecked="SetFlyoutCheckbox_Unchecked" />

                <TextBlock
                    Text="Status"
                    Style="{DynamicResource StandardGroupHeader}"
                    Margin="0,16,0,8" />
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>

                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>

                    <TextBlock Grid.Row="0">Click count:</TextBlock>
                    <TextBlock
                        x:Name="ClickCountTextBlock"
                        AutomationProperties.Name="ClickCountTextBlock"
                        Margin="4,0,0,0"
                        Text="0"
                        Grid.Row="0"
                        Grid.Column="1" />
                    <TextBlock Grid.Row="1">Flyout opened:</TextBlock>
                    <TextBlock
                        x:Name="FlyoutOpenedCountTextBlock"
                        AutomationProperties.Name="FlyoutOpenedCountTextBlock"
                        Margin="4,0,0,0"
                        Text="0"
                        Grid.Row="1"
                        Grid.Column="1" />
                    <TextBlock Grid.Row="2">Flyout closed:</TextBlock>
                    <TextBlock
                        x:Name="FlyoutClosedCountTextBlock"
                        AutomationProperties.Name="FlyoutClosedCountTextBlock"
                        Margin="4,0,0,0"
                        Text="0"
                        Grid.Row="2"
                        Grid.Column="1" />
                </Grid>


            </StackPanel>
        </ScrollViewer>
    </Grid>
</local:TestPage>
