Fullscreen on Mac

Eduardo Gomez Romero 205 Reputation points
2024-04-24T14:23:22.0966667+00:00

I made it fullscreem for Windows.

                .ConfigureLifecycleEvents(events => {
#if WINDOWS
                    events.AddWindows(windows => windows
                            .OnWindowCreated((window) => {

                                window.ExtendsContentIntoTitleBar = false;
                                var handle = WinRT.Interop.WindowNative.GetWindowHandle(window);
                                var id = Microsoft.UI.Win32Interop.GetWindowIdFromWindow(handle);
                                var appWindow = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(id);
                                switch (appWindow.Presenter) {
                                    case Microsoft.UI.Windowing.OverlappedPresenter overlappedPresenter:
                                        overlappedPresenter.Maximize();
                                        break;
                                }
                            }));
#endif


I was searching the Apple docs and they have a tooglefullscrren in NSScreem, but how to use it

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,900 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,451 Reputation points Microsoft Vendor
    2024-04-25T07:27:50.6466667+00:00

    Hello,

    toggleFullScreen: method is not suitable for MacCatalyst, it's for MacCocoa App, so you cannot access it.

    And there is a known issue reported at GitHub-Fullscreen · Issue #5478 · dotnet/maui · GitHub, please follow the progress.

    Best Regards,

    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments