<ui:Page
    x:Class="ModernWpf.SampleApp.ControlPages.ContextMenuPage"
    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">

    <ScrollViewer>
        <ui:SimpleStackPanel Style="{StaticResource ControlPageContentPanelStyle}">
            <sc:ControlExample HeaderText="A ContextMenu with checkable MenuItems and Separator.">
                <Button Content="Options">
                    <Button.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="Reset" />
                            <Separator />
                            <MenuItem
                                Header="Repeat"
                                IsCheckable="True"
                                IsChecked="True" />
                            <MenuItem
                                Header="Shuffle"
                                IsCheckable="True"
                                IsChecked="True" />
                        </ContextMenu>
                    </Button.ContextMenu>
                </Button>
            </sc:ControlExample>

            <sc:ControlExample HeaderText="A ContextMenu with cascading menus.">
                <Button Content="File Options">
                    <Button.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="Open" />
                            <MenuItem Header="Send to">
                                <MenuItem Header="Bluetooth" />
                                <MenuItem Header="Desktop (shortcut)" />
                                <MenuItem Header="Compressed file">
                                    <MenuItem Header="Compress and email" />
                                    <MenuItem Header="Compress to .7z" />
                                    <MenuItem Header="Compress to .zip" />
                                </MenuItem>
                            </MenuItem>
                        </ContextMenu>
                    </Button.ContextMenu>
                </Button>
            </sc:ControlExample>

            <sc:ControlExample HeaderText="A ContextMenu with icons.">
                <Button Content="Edit Options">
                    <Button.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="Share">
                                <MenuItem.Icon>
                                    <ui:FontIcon Glyph="&#xE72D;" />
                                </MenuItem.Icon>
                            </MenuItem>
                            <MenuItem Header="Copy">
                                <MenuItem.Icon>
                                    <ui:FontIcon Glyph="&#xE16F;" />
                                </MenuItem.Icon>
                            </MenuItem>
                            <MenuItem Header="Delete">
                                <MenuItem.Icon>
                                    <ui:FontIcon Glyph="&#xE107;" />
                                </MenuItem.Icon>
                            </MenuItem>
                            <Separator />
                            <MenuItem Header="Rename" />
                            <MenuItem Header="Select" />
                        </ContextMenu>
                    </Button.ContextMenu>
                </Button>
            </sc:ControlExample>

            <sc:ControlExample HeaderText="A ContextMenu with icons and InputGestureTexts.">
                <Button Content="Edit Options">
                    <Button.ContextMenu>
                        <ContextMenu>
                            <MenuItem
                                Header="Share"
                                InputGestureText="Ctrl+S">
                                <MenuItem.Icon>
                                    <ui:FontIcon Glyph="&#xE72D;" />
                                </MenuItem.Icon>
                            </MenuItem>
                            <MenuItem
                                Header="Copy"
                                InputGestureText="Ctrl+C">
                                <MenuItem.Icon>
                                    <ui:FontIcon Glyph="&#xE16F;" />
                                </MenuItem.Icon>
                            </MenuItem>
                            <MenuItem
                                Header="Delete"
                                InputGestureText="Delete">
                                <MenuItem.Icon>
                                    <ui:FontIcon Glyph="&#xE107;" />
                                </MenuItem.Icon>
                            </MenuItem>
                            <Separator />
                            <MenuItem Header="Rename" />
                            <MenuItem Header="Select" />
                        </ContextMenu>
                    </Button.ContextMenu>
                </Button>
            </sc:ControlExample>

            <sc:ControlExample HeaderText="A context MenuFlyout with icons and InputGestureTexts.">
                <Button Content="Edit Options">
                    <ui:ContextFlyoutService.ContextFlyout>
                        <ui:MenuFlyout>
                            <MenuItem
                                Header="Share"
                                InputGestureText="Ctrl+S">
                                <MenuItem.Icon>
                                    <ui:FontIcon Glyph="&#xE72D;" />
                                </MenuItem.Icon>
                            </MenuItem>
                            <MenuItem
                                Header="Copy"
                                InputGestureText="Ctrl+C">
                                <MenuItem.Icon>
                                    <ui:FontIcon Glyph="&#xE16F;" />
                                </MenuItem.Icon>
                            </MenuItem>
                            <MenuItem
                                Header="Delete"
                                InputGestureText="Delete">
                                <MenuItem.Icon>
                                    <ui:FontIcon Glyph="&#xE107;" />
                                </MenuItem.Icon>
                            </MenuItem>
                            <Separator />
                            <MenuItem Header="Rename" />
                            <MenuItem Header="Select" />
                        </ui:MenuFlyout>
                    </ui:ContextFlyoutService.ContextFlyout>
                </Button>
            </sc:ControlExample>

            <sc:ControlExample HeaderText="Text control ContextMenu.">
                <TextBox
                    Text="Some text"
                    MinWidth="150" />
            </sc:ControlExample>
        </ui:SimpleStackPanel>
    </ScrollViewer>
</ui:Page>
