Anil Kumar
Anil Kumar

Reputation: 303

how to set normal button menu items into AppBarButton in windows phone app8.1?

Hi below is my sample button code.

 <Button  VerticalAlignment="Bottom" HorizontalAlignment="Right"  Height="97" BorderThickness="0" Margin="331,0,-40,-62" >
                            <StackPanel>
                                <Image Source="Images/ic_navigation_drawer.png" Stretch="Fill" Width="59" Height="39"  />
                            </StackPanel>
                            <Button.Flyout>
                                <MenuFlyout>
                                    <MenuFlyoutItem x:Name="reloadcash" Text="Reloadcash" Click="reloadcash_Click" />
                                    <MenuFlyoutItem x:Name="prevoiusorders" Text="Previous orders" Click="prevoiusorders_Click"/>
                                    <MenuFlyoutItem x:Name="profile" Text="profile" Click="profile_Click"/>
                                    <MenuFlyoutItem x:Name="changepassword" Text="changepassword" Click="changepassword_Click"/>
                                    <MenuFlyoutItem x:Name="Contacts" Text="Contacts" Click="Contacts_Click"/>
                                    <MenuFlyoutItem x:Name="busorderhistory" Text="Busorderhistory" Click="busorderhistory_Click"></MenuFlyoutItem>

                                </MenuFlyout>
                            </Button.Flyout>
                        </Button>

now I want to set above menuflyout items into AppBarButton.

whenever I click AppBarbutton,that time all the menu items are display. how to display all the menu items in AppBarbutton. how to s

Upvotes: 0

Views: 61

Answers (1)

Mohanvel V
Mohanvel V

Reputation: 788

Same as if like Button flyout add AppBarButton and flyout inside the AppBarButton.

<AppBarButton Icon="OpenPane" Label="menu">
            <AppBarButton.Flyout>
                <MenuFlyout>
                    <MenuFlyoutItem x:Name="reloadcash" Text="Reloadcash" Click="reloadcash_Click" />
                    <MenuFlyoutItem x:Name="prevoiusorders" Text="Previous orders" Click="prevoiusorders_Click"/>
                    <MenuFlyoutItem x:Name="profile" Text="profile" Click="profile_Click"/>
                    <MenuFlyoutItem x:Name="changepassword" Text="changepassword" Click="changepassword_Click"/>
                    <MenuFlyoutItem x:Name="Contacts" Text="Contacts" Click="Contacts_Click"/>
                    <MenuFlyoutItem x:Name="busorderhistory" Text="Busorderhistory" Click="busorderhistory_Click"/>
                </MenuFlyout>
            </AppBarButton.Flyout>
        </AppBarButton>

This works fine.

Upvotes: 2

Related Questions