English 中文(简体)
是否有办法允许用户在“WinUI”评估器完全筛选时进入所有权区?
原标题:Is there a way to allow the user to access the titlebar when in fullscreen mode of a WinUI app?

我的申请(NET MAUI)在UWP中使用了完全筛选功能,自WinUI AP改变以来,我已经翻了。

这种方法的问题在于它掩盖了窗户的所有权障碍(它有背顿、近海等)。 关于UWP,在屏幕顶部附近进行 h,仍然可以进入这一称号。 WinUI能否让用户使用类似于UWP的完全筛选方式,以便他们能够回头,关闭镜头,有完全的屏幕等?

这是我在WinUI使用全屏幕的代码:

        var appWindow = GetAppWindow();

        if (appWindow == null)
        {
            return;
        }

        // set the Windows preference and immediately switch fullscreen mode
        if (fullscreen)
        {
            appWindow.SetPresenter(AppWindowPresenterKind.FullScreen);
        }
        else
        {
            appWindow.SetPresenter(AppWindowPresenterKind.Default);
        }
问题回答

您可尝试使用<代码>OverlappedPresenter,以尽量扩大屏幕和显示所有权条码。 下面是MauiProgram.cs的一条线。

        builder.ConfigureLifecycleEvents(events =>
        {
#if WINDOWS
            events.AddWindows(windows =>
            {
                windows.OnWindowCreated(window =>
                {
                    IntPtr windowHandle = WinRT.Interop.WindowNative.GetWindowHandle(window);
                    WindowId windowId = Win32Interop.GetWindowIdFromWindow(windowHandle);
                    var appWindow = AppWindow.GetFromWindowId(windowId);
                        
                    //Use presenter to determine the look and feel of the window.                  
                    switch (appWindow.Presenter)
                    {
                        case OverlappedPresenter overlappedPresenter:
                            overlappedPresenter.SetBorderAndTitleBar(true, true);
                            overlappedPresenter.Maximize();
                            break;
                    }
                });
            });
#endif
        });

That AppWindow has a Presenter, right now through .NET MAUI, we always set that presenter to the OverlappedPresenter. That is why there is only one option in the switch statement. This presenter determines the look and feel of the window.

在这里,我们利用<条码>过期的Presenter.Maximize()设置了完整的屏幕,由于你想有一个进行导航的称号,你可以设立<条码>过期的座标。


A. 更新

完全筛选模式和最大化是视窗的不同邦。 最大化确实有所有权障碍,而完全筛选方式则没有。 如果你想要在马库里用一个标题的酒吧进行完全筛选,你可以在上提出一个特征要求。





相关问题
Unable to access file in ResourcesSounds folder

I m using .net Maui and attempting to create audioManager players for a couple of sound files located in the ResourcesSounds folder in the project. The code is this: var playerStartSound = ...

.NET MAUI native audio player

I am interested is there a way to play mp3 files from the phone internal memory using the built in native audio player. I am asking this, because I want to implement an equalizer too, so I am guessing ...

Integrating Push Notifications in MAUI .NET 7 Applications

I m developing a cross-platform application using MAUI .NET 7 and I would like to add push notification functionality to my application. I m considering using Firebase Cloud Messaging or Azure ...

Databinding doesnt work in my xaml.cs file

I am trying to load some data from my Model to the xaml.cs file. But it doesn t work. In my Mainpage.xaml i have a binding property inside a label. In the code behind file a BindingContext to my ...

Do some tasks after OnAppearing() in MAUI

I have a maui community toolkit expander control in my page. On Tapping the header the content is shown/hidden .I got a Maui map in the expander s content. It display properly if the expander is in ...

NET MAUI是否有可调整的分辨率特征?

页: 1 NET MAUI用于一个即将到来的项目,但我发现一件失踪的事情是,我需要的是分裂的特征。 我发现,散射器在移动上可能不会产生作用,但Im主要针对Windows......。

How to optimize detail page reset button in C# MAUI?

I ve implemented a Reset button on a Detail page in C# MAUI and it works, but I can t figure out why I need to be so explicit in the way I capture the initial data to perform the reset, when requested....

热门标签