UWP显示全屏弹出,ContentDialog或弹出窗口

我需要在我的UWP应用程序中显示一个全屏对话框(在应用程序窗口边界中),但似乎无法使其工作。 我尝试过:

  • ContentDialog仅显示使用FullSizeDesired =“True”进行垂直拉伸

  • 弹出窗口,甚至试图在代码中设置宽度和高度不起作用

  • Flyout Placement =“Full”仅垂直拉伸,就像contentdialog一样

不敢相信我花了那么多时间在那件事上:(

谢谢

你尝试过这样的事情:

var c = Window.Current.Bounds; var g = new Grid { Width = c.Width, Height = c.Height, Background = new SolidColorBrush(Color.FromArgb(0x20, 0, 0, 0)), Children = { new Rectangle { Width = 100, Height = 100, Fill = new SolidColorBrush(Colors.White), Stroke = new SolidColorBrush(Colors.Black), StrokeThickness = 3 } } }; var p = new Popup { HorizontalOffset = 0, VerticalOffset = 0, Width = c.Width, Height = c.Height, Child = g }; p.IsOpen = true; // open when ready 

您应该会看到一个半透明的叠加层,屏幕中间有一个白色矩形。