Search code examples
uwpwindows-runtimewindows-store-appswindows-10windows-10-universal

Windows 10 universal app - Run in fullscreen mode by default


I have application with target windows 8.1 and when I run this application on Windows 10, it is run in small window by default.

Because it is primary tablet application I need it to run in full-screen mode by default. Is it possible to set it somewhere in Visual Studio or in some config of the application?


Solution

  • To launch application in full screen mode, try setting ApplicationView.PreferredLaunchWindowingMode as early as in App.xaml.cs's constructor

    public App()
    {
        ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;
    

    To have a button that toggles the full screen mode, do

    var view = ApplicationView.GetForCurrentView();
    if (view.IsFullScreenMode)
    {
        view.ExitFullScreenMode();
    }
    else
    {
        view.TryEnterFullScreenMode();
    }
    

    However, I need to add that even without specifying any of the code above, when you open your app inside a Windows 10 tablet or a Windows 10 desktop with Tablet Mode enabled, the app will automatically maximise itself to full screen.

    As long as your app is available on Windows 10 Desktop devices, I would recommend you not to set it to full screen at start-up 'cause UX wise it's a lot easier for desktop users to work with windowed applications.