<UserControl
    x:Class="Ursa.Demo.Pages.NavMenuDemo"
    xmlns="https://github.com/avaloniaui"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:u="https://irihi.tech/ursa"
    xmlns:vm="using:Ursa.Demo.ViewModels"
    d:DesignHeight="450"
    d:DesignWidth="800"
    x:CompileBindings="True"
    x:DataType="vm:NavMenuDemoViewModel"
    mc:Ignorable="d">
    <ScrollViewer>
        <StackPanel>
            <TextBlock Text="{ReflectionBinding #menu2.SelectedItem.Header}"></TextBlock>
            <u:NavMenu Name="menu2">
                <u:NavMenuItem Header="Menu 1">
                    <u:NavMenuItem.Icon>
                        <Rectangle
                            Width="10"
                            Height="10"
                            Fill="Red" />
                    </u:NavMenuItem.Icon>
                    <u:NavMenuItem Header="Sub Menu 1"></u:NavMenuItem>
                    <u:NavMenuItem Header="Sub Menu 2"></u:NavMenuItem>
                    <u:NavMenuItem Header="Sub Menu 3"></u:NavMenuItem>
                </u:NavMenuItem>
                <u:NavMenuItem Header="Menu 2">
                    <u:NavMenuItem.Icon>
                        <Rectangle
                            Width="20"
                            Height="10"
                            Fill="Red" />
                    </u:NavMenuItem.Icon>
                </u:NavMenuItem>
                <u:NavMenuItem Header="Menu 3">
                    <u:NavMenuItem.Icon>
                        <Rectangle
                            Width="30"
                            Height="10"
                            Fill="Red" />
                    </u:NavMenuItem.Icon>
                </u:NavMenuItem>
            </u:NavMenu>
            <u:Divider Content="Divider" />
            <TextBlock Text="{ReflectionBinding #menu.SelectedItem.Header}" />
            <u:NavMenu
                Name="menu"
                ItemsSource="{Binding MenuItems}"
                HeaderBinding="{Binding Header}"
                SubMenuBinding="{Binding  Children}"
                IconBinding="{Binding}">
                <u:NavMenu.IconTemplate>
                    <DataTemplate>
                        <Rectangle Width="10" Height="10" Fill="Blue"></Rectangle>
                    </DataTemplate>
                </u:NavMenu.IconTemplate>
            </u:NavMenu>
        </StackPanel>
    </ScrollViewer>
</UserControl>
