【发布时间】:2021-11-04 18:56:58
【问题描述】:
我正在维护一个在公共大屏幕上显示实时内容的应用程序。
有 2 个窗口,主窗口允许用户选择要在大屏幕上显示的内容,另一个是由安装的大屏幕驱动程序捕获并显示在大屏幕上的新窗口。
问题来自于一个大客户报告说大屏幕内容显示标题栏控件(最小化、最大化和关闭)并且他的大屏幕驱动程序只允许他捕获整个窗口。
这是一个关于我如何创建窗口的代码示例:
public Frame PublicScreenFrame { get; private set; }
private async void CreateWindow()
{
var window = await AppWindow.TryCreateAsync();
window.RequestSize(new Size(500, 500)); //Configured resolution for the screen
window.TitleBar.ExtendsContentIntoTitleBar = true; //I try to make the TitleBar transparent, but the controls still there
PublicScreenFrame = new Frame();
ElementCompositionPreview.SetAppWindowContent(window, PublicScreenFrame);
await window.TryShowAsync();
}
我发现我可以使标题栏透明并更改其控件前景的颜色,但不能使它们透明或不可见。
是否有任何解决方法,但是隐藏标题栏控件是 hacky 和过度设计的? 有什么方法可以让窗口以指定的分辨率进入“窗口化全屏”模式,从而解决问题?
【问题讨论】:
-
如果答案已经解决了您的问题,请mark它被接受
标签: xaml uwp windows-community-toolkit uwp-navigation