gpt4 book ai didi

windows - 当另一个AppWindow在第二个监视器上进入Fullscreen时,如何使UWP AppWindow保持全屏显示?

转载 作者:行者123 更新时间:2023-12-03 11:11:55 25 4
gpt4 key购买 nike

我试图在全屏的单独显示器上打开2个AppWindows(appWindowOne和appWindowTwo),但是当appWindowTwo打开时,appWindowOne会最小化。我尝试以编程方式使AppWindow重新进入全屏状态,但它会使其他AppWindow最小化。当在任务栏中手动单击时,它会恢复为全屏显示,而不会影响其他屏幕,但是我想知道是否可以通过编程方式进行?

public static async void ShowAppWindows()
{
AppWindow appWindowOne = await AppWindow.TryCreateAsync();
Frame frameOne = new Frame();
ElementCompositionPreview.SetAppWindowContent(appWindowOne, frameOne);

AppWindow appWindowTwo = await AppWindow.TryCreateAsync();
Frame frameTwo = new Frame();
ElementCompositionPreview.SetAppWindowContent(appWindowTwo, frameTwo);

FullScreenPresentationConfiguration FSPC = new FullScreenPresentationConfiguration()
{
IsExclusive = false
};

await appWindowOne.TryShowAsync();
appWindowOne.RequestMoveToDisplayRegion(displayRegions[0]);
appWindowOne.Presenter.RequestPresentation(FSPC);

await appWindowTwo.TryShowAsync();
appWindowTwo.RequestMoveToDisplayRegion(displayRegions[1]);
appWindowTwo.Presenter.RequestPresentation(FSPC);
}

最佳答案

. I've tried making the AppWindow re-enter full screen programmatically but it causes the other AppWindow to minimize.



当使 appWindowTwo进入全屏显示时,UI线程已损坏。我猜想在全屏中连续设置两个窗口会耗尽UI线程。因此,我们可以在将 Task.Delay()变成全屏之前尝试调用 appWindowTwo

关于windows - 当另一个AppWindow在第二个监视器上进入Fullscreen时,如何使UWP AppWindow保持全屏显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61603569/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com