13

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?

Justin XL
  • 38,763
  • 7
  • 88
  • 133
y0j0
  • 3,369
  • 5
  • 31
  • 52
  • 1
    The porting guide [is here](https://msdn.microsoft.com/en-us/library/windows/apps/mt188204.aspx). I assume you are looking for the section way at the bottom, as good as it gets. – Hans Passant Aug 01 '15 at 06:55

3 Answers3

37

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.

Justin XL
  • 38,763
  • 7
  • 88
  • 133
  • 1
    Thanks for advice. But did you mean store application. Because your code is not available in windows store universal app. http://prntscr.com/8hv4mh – y0j0 Sep 18 '15 at 20:49
  • Now I see, this code is available only in Windows 10 universal app. I'm trying this in windows 8.1 app – y0j0 Sep 18 '15 at 20:53
  • Make sure to add 'using Windows.UI.ViewManagement;' to the top off your App.xaml.cs – JayCrossler Aug 23 '21 at 15:58
4

And in C++ :

Windows::UI::ViewManagement::ApplicationView::PreferredLaunchWindowingMode = 
Windows::UI::ViewManagement::ApplicationViewWindowingMode::FullScreen;
A-Sharabiani
  • 17,750
  • 17
  • 113
  • 128
RelativeGames
  • 1,593
  • 2
  • 18
  • 27
1

try this:

this.InitializeComponent();
ApplicationView.GetForCurrentView().TryResizeView(new Size(1360, 768));
David Buck
  • 3,752
  • 35
  • 31
  • 35