MauiFullScreen is a simple and efficient .NET MAUI library to manage full-screen mode in your applications.
- Enable / Disable: Change the full-screen state on the fly.
- Toggle: Switch between full-screen and windowed mode.
- State Tracking: Check full-screen state for an individual window.
The methods directly extend the Microsoft.Maui.Controls.Window object. Invoke full-screen operations on the UI thread after the native window is ready. window.IsFullScreen() reads the native presenter on Windows and the native state on Mac Catalyst (or the requested state during a transition). On Android and iOS, it reports the state last applied by this helper, not external system changes. The old global FullScreenHelper.IsFullScreen property is obsolete and reports only the last state set or observed by the helper.
On Windows, full-screen mode uses the native FullScreenPresenter, which hides the window chrome and taskbar. Exiting full screen restores the previous presenter and its window state; if no presenter was saved by this helper, it applies the default presenter. The window must have a native handler before these methods are called.
On Android, the tracked state is reset when the native activity window is recreated; enable full screen again after the new window is ready. On Mac Catalyst, only a single key MAUI window is supported, and the AppKit main window must also be key. A conflicting request during a full-screen transition throws; if AppKit does not report completion, further changes remain blocked. The mapping between the MAUI and AppKit windows is an assumption and must be validated on macOS.
using MauiFullScreen;
// Check this window's current state once its native handler is ready
bool isFull = Window?.IsFullScreen() ?? false;
// Enable full-screen mode
Window?.EnableFullScreen();
// Disable full-screen mode
Window?.DisableFullScreen();
// Toggle between full-screen and windowed mode
Window?.ToggleFullScreen();
// Set the full-screen state directly
Window?.SetFullScreen(isFull);These extension methods are available only when compiling for their platform. Call them on the UI thread after the window's native handler is ready.
#if WINDOWS
Window?.Maximize();
Window?.Minimize();
Window?.Restore();
#endif
#if ANDROID
Window?.HideStatusBar();
Window?.ShowStatusBar();
Window?.HideNavigationBar();
Window?.ShowNavigationBar();
#endifOn Windows, these commands require an OverlappedPresenter. They throw InvalidOperationException for a full-screen or compact-overlay presenter; exit that mode explicitly first. Restore restores a minimized or maximized window and does not exit full screen.
On Android, individual bar commands do not change IsFullScreen(). They throw while full screen is active, and entering full screen throws if a bar has been individually hidden by this helper. Show the bars before entering full screen, and exit full screen before changing a bar. The helper tracks these individual requests per native window, not external system changes; Android may also reveal hidden bars temporarily via gestures. The window must be attached and the insets controller available. These APIs no longer exist on other platforms; wrap existing calls in #if ANDROID. Direct static calls such as FullScreenHelper.HideStatusBar(window) must be changed to AndroidSystemBarExtensions.HideStatusBar(window) or window.HideStatusBar().
The following example shows how to integrate the state change with a button and adjust the SafeAreaEdges for a truly immersive rendering, particularly on mobile devices:
void OnFullScreenClicked(object? sender, EventArgs e)
{
if (Window is not { } window)
return;
window.ToggleFullScreen();
bool isFullScreen = window.IsFullScreen();
SafeAreaEdges = MainRoot.SafeAreaEdges = isFullScreen
? SafeAreaEdges.None
: SafeAreaEdges.Default;
FullScreenBtn.Text = isFullScreen ? "FullScreen [On]" : "FullScreen [Off]";
}The library targets .NET 10 and .NET 11 on the platforms supported by .NET MAUI (Android, iOS, Windows, MacCatalyst). Building it requires the .NET 11 SDK and MAUI workload; the sample and tests also target .NET 10 and .NET 11. The minimum Android version is API 21 for the .NET 10 target and API 24 for the .NET 11 target, as required by the .NET 11 Android workload. Android-specific implementations select the appropriate system-bar and display-cutout APIs at runtime.
Note regarding iOS and MacCatalyst: These platforms have not been tested. Developing, building, and testing applications for Apple platforms strictly requires Apple-branded hardware (a Mac) according to Apple's End User License Agreement (EULA). Since I do not currently possess the appropriate legal Apple hardware, these platforms remain untested. Contributions, bug reports, and pull requests from developers with macOS environments are highly appreciated!