我想在我的通用Windows平台应用程序(C#)中在屏幕上显示一个模态窗口,就像添加帐户时标准的Mail-app一样.或者当您在应用程序中登录服务(如Facebook)时.
你可以移动这个窗口,但它不在任务栏中,它是模态的.
有谁知道如何做到这一点?它不应该那么难,但我找不到任何关于它的东西.
在 GridView 中,我试图在用户右键单击某个项目时显示上下文菜单。
我试过:
<GridView.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical" Width="120" Background="LightBlue">
<StackPanel.ContextFlyout>
<MenuFlyout>
<MenuFlyoutItem Text="Change color" Click="ChangeColorItem_Click" />
</MenuFlyout>
...
Run Code Online (Sandbox Code Playgroud)
但是StackPanel.ContextFlyout抛出错误。我缺少什么?
更新
错误是: The attachable property 'ContextFlyout' was not found in type 'StackPanel'
ContextFlyout 是 UIElement 的一个属性,StackPanel 派生自 UIElement。