我需要在我的UWP应用程序中显示一个全屏对话框(在应用程序窗口边界中),但似乎无法使其工作.我尝试过:
> ContentDialog仅显示使用FullSizeDesired =“True”进行垂直拉伸
> Popup,甚至试图在代码后面设置宽度和高度不起作用
> 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)),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
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。