c# – UWP显示全屏弹出,ContentDialog或弹出窗口
发布时间:2020-12-15 21:07:56 所属栏目:百科 来源:网络整理
导读:我需要在我的UWP应用程序中显示一个全屏对话框(在应用程序窗口边界中),但似乎无法使其工作.我尝试过: ContentDialog仅显示使用FullSizeDesired =“True”进行垂直拉伸 Popup,甚至试图在代码后面设置宽度和高度不起作用 Flyout Placement =“Full”只能像con
我需要在我的UWP应用程序中显示一个全屏对话框(在应用程序窗口边界中),但似乎无法使其工作.我尝试过:
> ContentDialog仅显示使用FullSizeDesired =“True”进行垂直拉伸 不敢相信我花了那么多时间在那件事上:( 谢谢 解决方法
你尝试过这样的事情:
var c = Window.Current.Bounds; var g = new Grid { Width = c.Width,Height = c.Height,Background = new SolidColorBrush(Color.FromArgb(0x20,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,Child = g }; p.IsOpen = true; // open when ready 您应该会看到一个半透明的叠加层,屏幕中间有一个白色矩形. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |