答案 0 :(得分:1)
有多种方法可以做到这一点。根据您的评论,一种方法可能是将虚拟UIElement放在地图下(使用合适的菜单)并在需要时显示它。 XAML:
<Grid x:Name="MainGrid" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Border x:Name="SamapleBorder" HorizontalAlignment="Left" VerticalAlignment="Top">
<Border.ContextFlyout>
<MenuFlyout Placement="Bottom">
<MenuFlyoutItem Text="Item 1"/>
<MenuFlyoutItem Text="Item 2"/>
<MenuFlyoutItem Text="Item 3"/>
</MenuFlyout>
</Border.ContextFlyout>
</Border>
<Rectangle Fill="Beige" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Tapped="Rectangle_Tapped"/>
</Grid>
和背后的代码:
private void Rectangle_Tapped(object sender, TappedRoutedEventArgs e) => this.SamapleBorder.ContextFlyout.ShowAt(this.SamapleBorder);