创建一个汉堡包子菜单

时间:2017-11-23 21:09:47

标签: wpf menu submenu hamburger-menu

我试图用子项目创建一个汉堡包菜单。我正在使用这个样本 https://github.com/alicanerdogan/HamburgerMenu并修改了一下。但我的子项目没有出现在菜单上。你能告诉我我做错了吗?

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        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:hamburgerMenu="clr-namespace:HamburgerMenu;assembly=HamburgerMenu" x:Class="HamburgerMenuDemo.MainWindow"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525" WindowStyle="None" AllowsTransparency="True" x:Name="This">
    <Grid>
        <hamburgerMenu:HamburgerMenu Background="Blue" MenuIconColor="White" SelectionIndicatorColor="White" MenuItemForeground="White" HorizontalAlignment="Left" Margin="0,10,0,-10">
            <hamburgerMenu:HamburgerMenu.Content>
                <hamburgerMenu:HamburgerMenuItem Icon="Assets/home.png" Text="Home" SelectionCommand="{Binding ElementName=This}"/>
                <hamburgerMenu:HamburgerMenuItem Icon="Assets/search.png" Text="Search"/>
                <hamburgerMenu:HamburgerMenuItem Icon="Assets/favorite.png" Text="Likes"/>
                <hamburgerMenu:HamburgerMenuItem Icon="Assets/list.png" Text="Lists"/>
                <hamburgerMenu:HamburgerMenuItem Icon="Assets/person.png" Text="Profile" >
                    <hamburgerMenu:HamburgerMenuItem.Content>
                        <hamburgerMenu:HamburgerMenuItem SelectionIndicatorColor="Red" Text="1"/>
                        <hamburgerMenu:HamburgerMenuItem SelectionIndicatorColor="Red" Text="2"/>
                        <hamburgerMenu:HamburgerMenuItem SelectionIndicatorColor="Red" Text="3"/>
                    </hamburgerMenu:HamburgerMenuItem.Content>
                </hamburgerMenu:HamburgerMenuItem>
            </hamburgerMenu:HamburgerMenu.Content>
        </hamburgerMenu:HamburgerMenu>
    </Grid>
</Window>

0 个答案:

没有答案