显示汉堡按钮的弹出窗口

时间:2017-06-14 14:56:10

标签: windows uwp-xaml hamburger-menu flyout

我想在汉堡包按钮上显示一个弹出按钮...就像在Windows 10注销时一样(见图)。

它有可能吗?!?

enter image description here

Jessica感谢您的回复,但在我的代码中,我可以把你的回复!?!

<Controls:HamburgerButtonInfo x:Name="LogoutButton" PageParameter="0" ButtonType="Command" Tapped="LogoutButton_Tapped">  
    <Controls:HamburgerButtonInfo.NavigationTransitionInfo>  
        <SuppressNavigationTransitionInfo />  
    </Controls:HamburgerButtonInfo.NavigationTransitionInfo>  
    <StackPanel Orientation="Horizontal">  
        <ToolTipService.ToolTip>  
            <TextBlock Text="Logout" x:Uid="logout_ToolTipService" TextWrapping="Wrap" />  
        </ToolTipService.ToolTip>  
        <SymbolIcon Width="48" Height="48" Symbol="Contact" />  
        <TextBlock Margin="12,0,0,0" Name="textBlock_LogoutButton"  x:Uid="textBlock_LogoutButton" VerticalAlignment="Center" Text="Logout" />  
    </StackPanel>  
</Controls:HamburgerButtonInfo>

1 个答案:

答案 0 :(得分:0)

<Button>  
    <FontIcon FontFamily="Segoe MDL2 Assets" Glyph="&#xE700;" />  
    <Button.Flyout>  
        <MenuFlyout>  
            <MenuFlyoutItem Text="Some text"/>  
            <ToggleMenuFlyoutItem Text="Some text 2"/>  
            <ToggleMenuFlyoutItem Text="Some text 3"/>  
        </MenuFlyout>  
    </Button.Flyout>  
</Button>