Windows runtime 如何在WinRT上重用弹出式菜单

Windows runtime 如何在WinRT上重用弹出式菜单,windows-runtime,windows-store-apps,windows-phone-8.1,winrt-xaml,Windows Runtime,Windows Store Apps,Windows Phone 8.1,Winrt Xaml,我有一个项目,其中有很多不同的listview/gridviews itemstemplate。 然而,所有人都共享相同的弹出式菜单,类似这样的东西 <FlyoutBase.AttachedFlyout > <MenuFlyout > <MenuFlyoutItem x:Uid="lbl_action_sheet_title_add_to_playlist" Text="$add to playlist

我有一个项目,其中有很多不同的listview/gridviews itemstemplate。 然而,所有人都共享相同的弹出式菜单,类似这样的东西

  <FlyoutBase.AttachedFlyout >
            <MenuFlyout >


                <MenuFlyoutItem x:Uid="lbl_action_sheet_title_add_to_playlist" Text="$add to playlist" />
                <MenuFlyoutItem x:Uid="lbl_action_sheet_share" Text="$share" />

            </MenuFlyout>
        </FlyoutBase.AttachedFlyout>

我想重复使用它,而不是复制粘贴到N个模板


有什么想法吗?

您可以使用附加的行为从
数据模板
资源附加菜单。

您能举个例子吗?这是我第一次听说这种可能性