<ui:Page
    x:Class="ModernWpf.SampleApp.ControlPages.FlyoutPage"
    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:ui="http://schemas.modernwpf.com/2019"
    xmlns:sc="clr-namespace:SamplesCommon;assembly=SamplesCommon"
    xmlns:local="clr-namespace:ModernWpf.SampleApp.ControlPages"
    mc:Ignorable="d">
    <ScrollViewer>
        <ui:SimpleStackPanel Style="{StaticResource ControlPageContentPanelStyle}">
            <sc:ControlExample
                HeaderText="A button with a flyout"
                HorizontalContentAlignment="Center"
                VerticalContentAlignment="Center">
                <Button
                    x:Name="Control1"
                    Content="Empty cart">
                    <ui:FlyoutService.Flyout>
                        <ui:Flyout x:Name="Flyout1">
                            <StackPanel>
                                <TextBlock
                                    Style="{StaticResource BaseTextBlockStyle}"
                                    Text="All items will be removed. Do you want to continue?"
                                    Margin="0,0,0,12" />
                                <Button
                                    Click="DeleteConfirmation_Click"
                                    Content="Yes, empty my cart" />
                            </StackPanel>
                        </ui:Flyout>
                    </ui:FlyoutService.Flyout>
                </Button>
                <sc:ControlExample.Options>
                    <ui:SimpleStackPanel Style="{StaticResource OptionsPanelStyle}">
                        <ui:RadioButtons
                            Header="Placement"
                            ItemsSource="{Binding Source={x:Type ui:FlyoutPlacementMode}, Converter={StaticResource EnumValuesConverter}}"
                            SelectedItem="{Binding ElementName=Flyout1, Path=Placement}" />
                    </ui:SimpleStackPanel>
                </sc:ControlExample.Options>
            </sc:ControlExample>
        </ui:SimpleStackPanel>
    </ScrollViewer>
</ui:Page>
